jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
679 stars 58 forks source link

Buttons onClick event doesnt work with Material Theme #47

Closed JTorresConsulta closed 6 years ago

JTorresConsulta commented 6 years ago

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 6 years ago

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.