feat(combobox): keyboard support for editable and configurable signal and selected index change behavior #80

Merged
FramePerfection merged 14 commits from fix/editable-combobox into main 2026-06-28 00:46:27 +00:00
FramePerfection commented 2026-05-04 17:38:19 +00:00 (Migrated from github.com)

This changes the signal_change behavior of comboboxes as follows:

  • While the listbox is open, the value is ongoing if the selected original index is different from control.selected_index, or none otherwise.
  • When the listbox was just closed and the selected original index is different from control.selected_index, the value is ended
  • The value is virtually never started. Should maybe be changed.

This enables users of the ugui.combobox API to react to the ended signal_change, fixing usability issues that would arise from prematurely updating the value fed into control.selected_index.

Additionally, the up and down arrow keys may be used to move the selected index, and enter may be used to confirm the selection (i.e. close the listbox).

This changes the `signal_change` behavior of comboboxes as follows: - While the listbox is open, the value is `ongoing` if the selected original index is different from `control.selected_index`, or `none` otherwise. - When the listbox was just closed and the selected original index is different from `control.selected_index`, the value is `ended` - The value is virtually never `started`. Should maybe be changed. This enables users of the `ugui.combobox` API to react to the `ended` signal_change, fixing usability issues that would arise from prematurely updating the value fed into `control.selected_index`. Additionally, the up and down arrow keys may be used to move the selected index, and enter may be used to confirm the selection (i.e. close the listbox).
FramePerfection commented 2026-05-04 17:40:33 +00:00 (Migrated from github.com)

@Aurumaker72 I can say that the behavior is now pretty much exactly what I'd want it to be, but the implementation is quite hacky.
Can you perhaps pick this up and clean it up properly? My head's a bit screwy right now 🥴

@Aurumaker72 I can say that the behavior is now pretty much exactly what I'd want it to be, but the implementation is quite hacky. Can you perhaps pick this up and clean it up properly? My head's a bit screwy right now 🥴
abart27 commented 2026-05-04 17:45:24 +00:00 (Migrated from github.com)

Yo, thanks a lot for this! Makes so much more sense semantically.

I can pick it up sure 👍

Yo, thanks a lot for this! Makes so much more sense semantically. I can pick it up sure 👍
abart27 commented 2026-05-05 15:48:18 +00:00 (Migrated from github.com)

The scope for this is too broad: the key navigation stuff is nice but should definitely be a separate PR.

The scope for this is too broad: the key navigation stuff is nice but should definitely be a separate PR.
abart27 commented 2026-05-05 15:54:27 +00:00 (Migrated from github.com)

Can you make a separate PR with just that? I can move the changes over to it if you want, but you should make the PR so you get the squash commit authorship

Can you make a separate PR with just that? I can move the changes over to it if you want, but you should make the PR so you get the squash commit authorship
abart27 (Migrated from github.com) approved these changes 2026-06-28 00:46:14 +00:00
abart27 (Migrated from github.com) left a comment

Awesome :D

Awesome :D
Sign in to join this conversation.
No description provided.