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
Omitting default actions if already provided #70
Comments
Makes sense, but should be based on We currently have a |
Maybe if no id is explicitly provided but the label is the same as a default menu item that default menu item should still be omitted? I just can't imagine a scenario where one would want 2 "Copy" menu items like shown in the screenshot.
I'd say the latter too.
Maybe, I'm currently updating the menus inside If there was a Maybe an I'd be happy to submit a PR implementing these features 👍 |
The reason I want to base it on
👍 That actually sounds more useful and flexible than my |
I see your point, but some apps don't deal with i18n at all, and those who do I guess would translate "Copy" from this library and the custom "Copy" item with the same string 🤔 I'll try to get the PR done by the end of the week 👍 |
I was referring to depending on overriding the "Copy" item here, then localizing and suddenly the override stops working as the labels no longer match. |
Yeah yeah, but one would want to localize this library too and assuming both instances of "Copy" get localized to the same string (but languages are complicated, maybe this assumption can't be made) the override would still work. |
It would be weird to have to translate the menu item here when you don't use it and instead override it with your. These are many reasons why as stable ID is better. |
I'm defining a custom "Copy" action, which does something a bit different than the default "Copy" action, to some buttons, but on right click the content of the button gets selected (and I can't make them unselectable) and so the menu displays 2 "Copy" actions, the one I defined and the one this library defines:
I think I could generate the whole menu manually via the
menu
option but that would mean detecting all the cases where the default actions should be showed.Could we instead add an option,
canOverrideDefaultActions
or something, where before inserting each default action the library check if another action with the same label has been provided already?The text was updated successfully, but these errors were encountered: