Open
Description
Describe the bug
It does not seem possible to add anon:click
to an Icon
belonging to a Textfield
.
Clicking on the Icon
doesn't do anything.
To Reproduce
Steps to reproduce the behavior:
<script>
import Textfield from '@smui/textfield';
import Icon from '@smui/textfield/icon';
let foo;
</script>
<form>
<Textfield bind:value={foo} label="Foo">
<Icon
class="material-icons"
slot="trailingIcon"
on:click={
() => {
console.log('bar');
}
}
>
add
</Icon>
</Textfield>
If you try to click on the icon, nothing will happen.
Expected behavior
The on:click
event should activate when you click on the icon.
Desktop (please complete the following information):
- Browser chrome, firefox
Additional context
It does work if you wrap the Icon
in a div
and add the on:click
the the div
. However, this causes a11y warnings that can only be resolved by writing more javascript code to handle keypresses.