mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(radio-tile): move keydown, tabindex to input element
This commit is contained in:
parent
a4d68e7e00
commit
17d97d1dbf
2 changed files with 13 additions and 10 deletions
|
@ -57,14 +57,21 @@
|
|||
name="{name}"
|
||||
value="{value}"
|
||||
checked="{checked}"
|
||||
tabindex="{tabindex}"
|
||||
class:bx--tile-input="{true}"
|
||||
on:change
|
||||
on:change="{() => {
|
||||
update(value);
|
||||
}}"
|
||||
on:keydown
|
||||
on:keydown="{(e) => {
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
update(value);
|
||||
}
|
||||
}}" />
|
||||
<label
|
||||
for="{id}"
|
||||
tabindex="{tabindex}"
|
||||
class:bx--tile="{true}"
|
||||
class:bx--tile--selectable="{true}"
|
||||
class:bx--tile--is-selected="{checked}"
|
||||
|
@ -73,14 +80,7 @@
|
|||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
on:keydown
|
||||
on:keydown="{(e) => {
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
update(value);
|
||||
}
|
||||
}}">
|
||||
on:mouseleave>
|
||||
<span class:bx--tile__checkmark="{true}">
|
||||
<CheckmarkFilled16
|
||||
aria-label="{iconDescription}"
|
||||
|
|
|
@ -52,7 +52,10 @@
|
|||
{...$$props}
|
||||
value="{value}"
|
||||
id="{id}"
|
||||
labelText="{labelText}">
|
||||
labelText="{labelText}"
|
||||
on:keydown="{() => {
|
||||
console.log('keydown');
|
||||
}}">
|
||||
Selectable Tile
|
||||
</RadioTile>
|
||||
{/each}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue