-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
BeginGroup causing popups to trigger BeginDragDropSource #2840
Comments
Hello Edward,
I can look into it but it also seems like an odd UX decision to make the whole thing a drag source. Have you considered using a small button (eg using an icon as label) next to the combo box?
Omar
|
Hi Omar, Adding a drag-source button/icon is something we've considered and we may still do, though there are screen-space concerns and aesthetic reasons why we don't want to do it if possible. It's also not suitable for all situations where we have a draggable element that may be in a group and could cause a popup can be generated. For example grid views that have a context popup, which can contain menu items (which unexpectedly become drag sources), or other elements on which you would naturally perform drag-like actions (eg number/text inputs). We could find a way to not use groups to accomplish this, but they're obviously a very useful solution for bundling a few widgets together and treating them as one. |
Hello, To clarify, in your Combo box, where do you expect to be dragging from?
If you have time to submit a little more details (e.g. gif/screens, no need for working repro) to understand the fuller context more in details it would generally help. Not absolutely necessary but it tends to facilitate designing better solutions. At the moment the code in EndGroup() decide if the group is active based on wether the active item was submitted between BeginGroup() and EndGroup(). calls It's a little bit of a wonky magic trick we are performing here. In
By adding
But this is also why I asked my first question above. Or, we could add more semantic/data along with g.ActiveId (e.g. g.ActiveIdWidgetTag, I don't know). In either case we could have to clarify what groups are, perhaps add a bunch of flags to them. |
(you may also go to Demo>About Window, and click "Config/Build Information" to obtain a bunch of detailed information that you can paste here)
Version/Branch of Dear ImGui:
Version: 1.72 WIP
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler: MSVC 1916
Operating System: Windows 10
My Issue/Question:
We have a combo widget that's a drag drop source. When the widget is surrounded with
BeginGroup
/EndGroup
, dragging on the scrollbar of the combo's popup (or any other widget within the popup) will incorrectly cause BeginDragDropSource to return true. WithoutBeginGroup
/EndGroup
, it doesn't start a drag.Screenshots/Video
First combo shows expected behaviour, second shows it broken - notice the little square of the colour drag next to the cursor
The text was updated successfully, but these errors were encountered: