-
-
Notifications
You must be signed in to change notification settings - Fork 218
feat: setting field improvements #2332
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
Conversation
|
Thanks, but I'd like to be able to switch settings by clicking on the whole field area. This can be achieved by checking the current selection's type in mousedown/up event handlers of the top-most Something like this: let rangeIsSelected = false
function onMouseDown(e: DOMEvent<MouseEvent>) {
rangeIsSelected = getSelection()?.type === 'Range'
if (e.detail > 1) e.preventDefault()
}
function onMouseUp(e: DOMEvent<MouseEvent>) {
if (rangeIsSelected || getSelection()?.type === 'Range') return
// And then field-specific stuff:
// For select-field
if (props.inactive || !props.opts || Array.isArray(props.value)) return
if (e.button === 0) switchOption(1)
if (e.button === 2) switchOption(-1)
// For toggle-field and count-field
toggle()
// text-field
focus()
}No need to change select-input component in this case. |
|
@mbnuqw perfect, thank you for the direction! just wanna take a look into a couple more small improvements before its ready to merge :) |
|
Also fixed this click-through propagation bug: Screen.Recording.2026-01-17.005146.mp4 |
|
sorry for the messy force push stuff, I wanted the commits to be tidier.
The fields in |
|
Awesome, thank you!
Yes, let's keep you're implementation.
That's |

TextInputon left-click, and switches/toggles theSelectInput/ToggleInputon right-click.Screen.Recording.2026-01-17.005146.mp4