cycfi / elements

Elements C++ GUI library
http://cycfi.github.io/elements/
3.15k stars 235 forks source link

Tooltips and input boxes #426

Open klytje opened 1 month ago

klytje commented 1 month ago

When using a tooltip with an input_box, the popup will steal the focus from the input box, making it difficult to enter new values.

Example from my interface: image Here, when the user hovers the input box, an explanatory popup appears to explain exactly what changing this value will do. Usually, however, the user would click the box beforehand to type a new value (with the mouse still hovering it), in which case the popup steals the focus when it appears. The user will then modify the text inside the popup instead of changing the value in the input box.

Another issue I noticed with these popups is that, for longer texts such as the one shown here, the popup itself is placed incorrectly the first time it appears. Compare the following first-time popup with the previous one: image Note that this only happens the first time. Every time it appears afterwards, it is correctly placed on top as in the first picture. This also happens with check_box, so perhaps it is a general issue with tooltips.

djowel commented 1 month ago

Can you make an MVCE, please?

djowel commented 1 month ago

Question: are you bringing up the tooltip while the user us typing some text?

djowel commented 1 month ago

Can you make an MVCE, please?

Suggestion: transform the tooltip example into one that exhibits your use case.

klytje commented 1 month ago

I'll try to find time to do it sometime next week.

klytje commented 1 month ago

Question: are you bringing up the tooltip while the user us typing some text?

It is appearing by itself since the mouse still hovers the text field when the user is typing. I think that behaviour is fine; the issue is that it steals the editing focus, so you modify the popup text instead of the input box.

djowel commented 1 month ago

Question: are you bringing up the tooltip while the user us typing some text?

It is appearing by itself since the mouse still hovers the text field when the user is typing. I think that behaviour is fine; the issue is that it steals the editing focus, so you modify the popup text instead of the input box.

Looks like a bug!