File tree Expand file tree Collapse file tree 7 files changed +65
-9
lines changed Expand file tree Collapse file tree 7 files changed +65
-9
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,27 @@ img {
186
186
}
187
187
}
188
188
189
+ .icon-button ,
190
+ .text-button ,
191
+ .popover-button ,
192
+ .checkbox-input label ,
193
+ .color-input .swatch .swatch-button ,
194
+ .dropdown-input .dropdown-box ,
195
+ .font-input .dropdown-box ,
196
+ .radio-input button ,
197
+ .menu-list {
198
+ & :focus {
199
+ outline : 1px solid var (--color-accent );
200
+ outline-offset : 2px ;
201
+ }
202
+ }
203
+
204
+ .menu-list {
205
+ & :focus {
206
+ outline-offset : -1px ;
207
+ }
208
+ }
209
+
189
210
// For placeholder messages (remove eventually)
190
211
.floating-menu {
191
212
h1 ,
Original file line number Diff line number Diff line change @@ -90,5 +90,11 @@ export default defineComponent({
90
90
this .dialog .dismissDialog ();
91
91
},
92
92
},
93
+ mounted() {
94
+ // Focus the first button in the popup
95
+ const element = this .$el as Element | null ;
96
+ const emphasizedOrFirstButton = (element ?.querySelector (" button.emphasized" ) as HTMLButtonElement | null ) || element ?.querySelector (" button" );
97
+ emphasizedOrFirstButton ?.focus ();
98
+ },
93
99
});
94
100
</script >
Original file line number Diff line number Diff line change 2
2
<FloatingMenu class =" menu-list" :direction =" direction" :type =" 'Dropdown'" ref =" floatingMenu" :windowEdgeMargin =" 0" :scrollableY =" scrollableY" data-hover-menu-keep-open >
3
3
<template v-for =" (section , sectionIndex ) in menuEntries " :key =" sectionIndex " >
4
4
<Separator :type =" 'List'" :direction =" 'Vertical'" v-if =" sectionIndex > 0" />
5
- <LayoutRow
5
+ <button
6
6
v-for =" (entry, entryIndex) in section"
7
7
:key =" entryIndex"
8
8
class =" row"
31
31
v-bind =" { defaultAction, minWidth, drawIcon, scrollableY }"
32
32
:ref =" (ref: any) => setEntryRefs(entry, ref)"
33
33
/>
34
- </LayoutRow >
34
+ </button >
35
35
</template >
36
36
</FloatingMenu >
37
37
</template >
42
42
padding : 4px 0 ;
43
43
44
44
.row {
45
+ display : flex ;
46
+ flex-direction : row ;
47
+ flex-grow : 1 ; // TODO: Note, this is overridden by the flex shorthand rule below
48
+ min-width : 0 ;
49
+ min-height : 0 ;
50
+ border : 0 ;
51
+ padding : 0 ;
52
+ text-align : left ;
53
+ background : none ;
45
54
height : 20px ;
46
55
align-items : center ;
47
56
white-space : nowrap ;
@@ -133,7 +142,6 @@ import { defineComponent, PropType } from "vue";
133
142
134
143
import { IconName } from " @/utilities/icons" ;
135
144
136
- import LayoutRow from " @/components/layout/LayoutRow.vue" ;
137
145
import FloatingMenu , { MenuDirection } from " @/components/widgets/floating-menus/FloatingMenu.vue" ;
138
146
import CheckboxInput from " @/components/widgets/inputs/CheckboxInput.vue" ;
139
147
import IconLabel from " @/components/widgets/labels/IconLabel.vue" ;
@@ -277,7 +285,6 @@ const MenuList = defineComponent({
277
285
IconLabel ,
278
286
CheckboxInput ,
279
287
UserInputLabel ,
280
- LayoutRow ,
281
288
},
282
289
});
283
290
export default MenuList ;
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<LayoutRow class =" checkbox-input" :class =" { 'outline-style': outlineStyle }" >
3
3
<input type =" checkbox" :id =" `checkbox-input-${id}`" :checked =" checked" @change =" (e) => $emit('update:checked', (e.target as HTMLInputElement).checked)" />
4
- <label :for =" `checkbox-input-${id}`" >
4
+ <label :for =" `checkbox-input-${id}`" tabindex = " 0 " @keydown.enter = " (e) => ((e.target as HTMLElement).previousSibling as HTMLInputElement).click() " >
5
5
<LayoutRow class =" checkbox-box" >
6
6
<IconLabel :icon =" icon" />
7
7
</LayoutRow >
21
21
label {
22
22
display : flex ;
23
23
height : 16px ;
24
+ // Provides rounded corners for the :focus outline
25
+ border-radius : 2px ;
24
26
25
27
.checkbox-box {
26
28
flex : 0 0 auto ;
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<LayoutRow class =" dropdown-input" >
3
- <LayoutRow class =" dropdown-box" :class =" { disabled }" :style =" { minWidth: `${minWidth}px` }" @click =" () => clickDropdownBox()" data-hover-menu-spawner >
3
+ <button class =" dropdown-box" :class =" { disabled }" :style =" { minWidth: `${minWidth}px` }" @click =" () => clickDropdownBox()" data-hover-menu-spawner >
4
4
<IconLabel class =" dropdown-icon" :icon =" activeEntry.icon" v-if =" activeEntry.icon" />
5
5
<span >{{ activeEntry.label }}</span >
6
6
<IconLabel class =" dropdown-arrow" :icon =" 'DropdownArrow'" />
7
- </LayoutRow >
7
+ </button >
8
8
<MenuList
9
9
v-model:activeEntry =" activeEntry"
10
10
@update:activeEntry =" (newActiveEntry: typeof MENU_LIST_ENTRY) => activeEntryChanged(newActiveEntry)"
23
23
position : relative ;
24
24
25
25
.dropdown-box {
26
+ display : flex ;
27
+ flex-direction : row ;
28
+ flex-grow : 1 ;
29
+ min-width : 0 ;
30
+ min-height : 0 ;
31
+ border : 0 ;
32
+ padding : 0 ;
33
+ text-align : left ;
34
+
26
35
align-items : center ;
27
36
white-space : nowrap ;
28
37
background : var (--color-1-nearblack );
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<LayoutRow class =" font-input" >
3
- <LayoutRow class =" dropdown-box" :class =" { disabled }" :style =" { minWidth: `${minWidth}px` }" @click =" () => clickDropdownBox()" data-hover-menu-spawner >
3
+ <button class =" dropdown-box" :class =" { disabled }" :style =" { minWidth: `${minWidth}px` }" @click =" () => clickDropdownBox()" data-hover-menu-spawner >
4
4
<span >{{ activeEntry.label }}</span >
5
5
<IconLabel class =" dropdown-arrow" :icon =" 'DropdownArrow'" />
6
- </LayoutRow >
6
+ </button >
7
7
<MenuList
8
8
v-model:activeEntry =" activeEntry"
9
9
@widthChanged =" (newWidth: number) => onWidthChanged(newWidth)"
20
20
position : relative ;
21
21
22
22
.dropdown-box {
23
+ display : flex ;
24
+ flex-direction : row ;
25
+ flex-grow : 1 ;
26
+ min-width : 0 ;
27
+ min-height : 0 ;
28
+ border : 0 ;
29
+ padding : 0 ;
30
+ text-align : left ;
31
+
23
32
align-items : center ;
24
33
white-space : nowrap ;
25
34
background : var (--color-1-nearblack );
Original file line number Diff line number Diff line change 65
65
margin : 0 4px ;
66
66
}
67
67
}
68
+
69
+ min-height : auto !important ;
68
70
}
69
71
</style >
70
72
You can’t perform that action at this time.
0 commit comments