mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Ignore disabled buttons on default hint mode
You can still click them if you use non-default hint modes which I think is probably what users expect
This commit is contained in:
parent
649a77962a
commit
6dade7d1fb
|
|
@ -86,6 +86,10 @@ function isEditableHTMLInput(element: HTMLInputElement) {
|
|||
return false
|
||||
}
|
||||
|
||||
export function isWithinDisabledFormControl(element: Element): boolean {
|
||||
return element.closest(":disabled:not(fieldset)") !== null
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch a mouse event to the target element
|
||||
* based on cVim's implementation
|
||||
|
|
|
|||
|
|
@ -414,12 +414,19 @@ export class HintConfig implements HintOptions {
|
|||
hinting.saveableElements(this.includeInvisible),
|
||||
)
|
||||
|
||||
default:
|
||||
return hinting.hintables(
|
||||
default: {
|
||||
const hintables = await hinting.hintables(
|
||||
DOM.HINTTAGS_selectors,
|
||||
this.jshints,
|
||||
this.includeInvisible,
|
||||
)
|
||||
for (const hintable of hintables) {
|
||||
hintable.elements = hintable.elements.filter(
|
||||
element => !DOM.isWithinDisabledFormControl(element),
|
||||
)
|
||||
}
|
||||
return hintables
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue