-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ComboBox clipped by window #825
Comments
Good find! The reason that the parent clip rect is respected at all is for the case when the combobox is in a scroll-area. However, maybe it is just easier to always ignore the parent clip rect, and let popups (including comboboxes) "escape" the parent. See /~https://github.com/emilk/egui/blob/master/egui/src/containers/popup.rs#L288 |
Another option is to move the popup to be within the parent clip rect, which would also solve #693 |
In my case the window is procedurally generated and based on parsed user input. So it's not really an option to move the combo box. The other issue is I would like to allow the ComboBox to be in a scroll Area since the user can input any number of input blocks which can cause the window to need a scroll bar. If the ComboBox dropdown being clipped is always bad (at least in y) then you can add a call to "expand_ui_clip_rect_y" and that should allow the dropdown to still work with a scroll area |
I misread your comment about moving the ComboBox, if the popup can be automatically moved to within the clip_rect that would solve my issue. It would also solve the issue with clipping when in a ScrollArea (second screenshot above) But wouldn't that require knowing how big the popup will be prior to drawing it? |
Describe the bug
When a Window has a ComboBox near the bottom some items in the list can be cut off.
To Reproduce
Steps to reproduce the behavior (Bottom clip - 1st screenshot):
Steps to reproduce the behavior (Bottom & Side clip 2nd screenshot):
Expected behavior
dropdown lists should not be clipped
Cause of issue
clip_rect of parent ui (window or scroll area) is being used to clip the dropdown list
Screenshots
Proposed solution
If the clip_rect of the ui is expanded immediately prior to drawing the dropdown popup and shrunk back afterwards, the problem can be fixed.
The vertical height of the clip_rect needs to be temporally expanded by "ui.spacing().combo_height"
I don't the required width expansion is easily determined
I believe the code change needs to be done in src\containers\popop.popup_below_widget
It might be best to make clip_rect expansion optional
functions to expand/shrink clip_rect:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: