Skip to content

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

@armata99

Description

@armata99

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions