Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: How can I disable context menu that pops up after selecting text? #18

Open
armata99 opened this issue Oct 24, 2024 · 0 comments

Comments

@armata99
Copy link

I'm trying to render a custom Context menu above selection. Therefore I have to disable system's default context menu.

How can I modify Swift side codes to do so? I tried React-Native's solution which is like below but it didn't work.

override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
        return false
}

override func buildMenu(with builder: UIMenuBuilder) {
    if #available(iOS 17.0, *) {
        builder.remove(menu: .autoFill)
    }
    super.buildMenu(with: builder)
}

I Added this in RNUITextView.swift and RNUITextViewChild.swift. Can anyone tell me what am I missing?

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant