File tree Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import Icon from ' $components/Icon.svelte' ;
3
+ import { focusable } from ' $lib/focus/focusable' ;
3
4
import { clickOutside } from ' $lib/utils/clickOutside' ;
4
5
import { pxToRem } from ' $lib/utils/pxToRem' ;
5
6
import { onMount , tick } from ' svelte' ;
176
177
style:text-align ={textAlign }
177
178
bind:value
178
179
bind:this ={htmlInput }
180
+ use:focusable ={{ button : true }}
179
181
{onclick }
180
182
{onmousedown }
181
183
oninput ={(e ) => {
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
+ import { focusable } from ' $lib/focus/focusable' ;
3
+
2
4
interface Props {
3
5
small? : boolean ;
4
6
disabled? : boolean ;
36
38
{value }
37
39
{id }
38
40
{disabled }
41
+ use:focusable ={{ button : true }}
39
42
/>
40
43
41
44
<style lang =" postcss" >
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ export class FModeManager {
178
178
return ;
179
179
}
180
180
181
- if ( isInputElement ( element ) ) {
181
+ if ( isInputElement ( element ) && element . type !== 'checkbox' ) {
182
182
element . focus ( ) ;
183
183
} else {
184
184
element . click ( ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export function getNavigationAction(key: string): NavigationAction | null {
12
12
return keyMap [ key ] ?? null ;
13
13
}
14
14
15
- export function isInputElement ( target : EventTarget | null ) : boolean {
15
+ export function isInputElement ( target : EventTarget | null ) : target is HTMLInputElement {
16
16
return (
17
17
( target instanceof HTMLElement && isContentEditable ( target ) ) ||
18
18
target instanceof HTMLTextAreaElement ||
You can’t perform that action at this time.
0 commit comments