Skip to content
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

Allow to disable SelectBoxScrollPane reset selection on exit behavior #7234

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fgnm
Copy link
Contributor

@fgnm fgnm commented Sep 23, 2023

There's a default behavior for SelectBoxScrollPane which is quite confusing on UX point of view. When the cursor exit from the scroll pane the selection is reset to the current value which create a bad UX, it's common to exit the scroll pane by mistake and this create confusions:

Video.del.2023-09-23.12-34-54.mp4

With this PR there's now an option to disable the default behavior:

Video.del.2023-09-23.12-40-47.mp4

Similar to the behavior of any other software:

Video.del.2023-09-23.12-41-43.mp4

(Dunno why I can't record the cursor, btw it enter end exit from the scroll pane)

@Berstanio
Copy link
Contributor

Honestly, I don't know why anyone would want the current behaviour?
I would think it would be better to disable the reset by default, but I'm not a UI person, so there might be other opinions about that.

@fgnm
Copy link
Contributor Author

fgnm commented Sep 25, 2023

I don't know why it was made in this way, but I didn't want to make it as a break change... There are years that SelectBox works in this way and no one never complained

@crykn crykn added this to the 1.12.1 milestone Oct 2, 2023
@crykn
Copy link
Member

crykn commented Oct 3, 2023

I agree with @Berstanio, I don't think we need to keep the old behaviour around. Maybe @NathanSweet has an opinion on this?

@NathanSweet
Copy link
Member

NathanSweet commented Oct 3, 2023

The premise for the proposed change is:

is quite confusing on UX point of view. When the cursor exit from the scroll pane the selection is reset to the current value which create a bad UX, it's common to exit the scroll pane by mistake and this create confusions

This is not descriptive enough. Please explain why you feel it's confusing.

When a select box list is shown, the select box value is selected in the list by default. To highlight which item is hovered, the list selection is changed to the hovered item. If the mouse is moved off the list, what is the point of keeping the last hovered item selected? It was selected solely to indicate the hovered item, but the hover is gone. Keeping it selected doesn't provide any useful information. If it was kept, it should not be used to set the select box value if the select box is closed by clicking away. It would be used if enter is pressed, but I don't think it's common to use a combination of mouse and keyboard to choose an item.

Some select box implementations keep the last hovered item selected, but I don't see that as an improvement over the current implementation. Showing hover state via list selection is OK, but otherwise I prefer to see the select box value selected. While that value can be seen in the select box itself, it's often helpful to see it selected in the list. In many cases the list is sorted or otherwise items near the selected item are important. It would not be great to lose where the select box value is in the list because you accidentally hovered some other item briefly.

When using the keyboard then it makes sense to keep the selected list item something other than the select box value. scene2d.ui's select box allows keyboard input to change the value without needing to keep the hovered item selected after the hover is gone.

I think an argument can be made for either approach, but I prefer it as implemented.

If we want to discuss a more substantial improvement in this area, I would suggest having a separate list highlight for hover than for the select box value. That way we get both without compromises.

@crykn crykn modified the milestones: 1.12.1, 1.12.2 Oct 15, 2023
@crykn crykn modified the milestones: 1.12.2, 1.12.3 Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants