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 |
* feat: selectable settings field labels (mbnuqw#2275) * fix: prevent context menu on setting fields unless text is selected * fix: click-through on `SelectInput` dropdown overlay * feat: left-click to focus TextInput, right click to modify setting * fix: text selection and and ctx menu in `TextInput`s
* feat: selectable settings field labels (mbnuqw#2275) * fix: prevent context menu on setting fields unless text is selected * fix: click-through on `SelectInput` dropdown overlay * feat: left-click to focus TextInput, right click to modify setting * fix: text selection and and ctx menu in `TextInput`s

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