Buttons onClick event doesnt work with Material Theme
Closed this issue · 1 comments
JTorresConsulta commented
Hi!
The buttons onClick event doesnt work with Material Theme but works correctly with Vanilla and Macos themes.
<link rel="stylesheet" href="node_modules/xel/stylesheets/material.theme.css">
<script src="node_modules/xel/xel.min.js"></script>
<x-button><x-label onclick="openURLNavigator()">Open in Navigator</x-label> </x-button>
<script>
function openURLNavigator() {
alert("Open Navigator clicked");
}
</script>
What I am doing bad?
Thanks
jarek-foksa commented
It's because <x-label>
has pointer-events: none
CSS property set by the Material theme. To fix this you should add the event listener to <x-button>
instead.