-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add support for SimpleMenu to use custom select options #6480
Add support for SimpleMenu to use custom select options #6480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't the remove_item
+ add_item
change the item order, if use_select_only
is True?
Do you mean the order of the components, i.e. where the select menu appears in the grid? If so then we don't offer a guarantee on that with this view. They appear in order preferring buttons then the menu last. If someone were to add their own components those would usually come after but could now come before the select menu. This PR is largely just so what was asked can be achieved without accessing private attributes. If people want complete control on the order of the components they should make their own view. |
I think the order we define in Red-DiscordBot/redbot/core/utils/views.py Lines 196 to 202 in 74b6fde
will no longer do anything since start() /start_dm() immediately changes it.
|
Ah that order, that was a special case so that a close button appeared under the select menu when applied. I can fix the logic so that is accounted for. |
Actually upon testing it is working as expected. This is because when we initially define each of the components their row is set automatically and when removed that spot is now free to be refilled. So the order does not change when we define it in init. |
I see. I don't really have any other complaints so... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description of the changes
Add the ability to customize the select options on SimpleMenu before sending. This Closes #6455.
Have the changes in this PR been tested?
Yes