I have a normally hidden button that becomes visible if the browser supports a certain API, however the button is always visible when inside a Livewire component.
Anyone knows if this unhiding is by design of Livewire?
In normal blade, I check for if (navigator.share) {... to unhide the button, how do we integrate this into Livewire?
Are you sure it is Livewire that unhides the button, or your custom script is executed? Put a console.log within the condition and make sure that it is not your JS part that unhides the button.
Quite sure it is not my javascript. I tested by taking out my javascript after your reply.
It worked in a normal blade component. And started becoming visible after I placed them into a Livewire component.
Before I started the discussion, I was trying to manipulate the display: none CSS in my developer tools and it gets deleted once I entered it. I'm not sure if Livewire is the culprit, but all things point to it.
Just slightly newer version of Chrome (Version 87.0.4280.67 (Official Build) (x86_64)) the rest is the same, and I am on a Mac. But this is not a way to debug it my friend.
I would comment all the other scripts just to make sure nothing is interfering with the page.
Hm, I really don't think it is Chrome that overrides manually neither the style nor the hidden attribute. As you said it is Bulma most probably that applies display:visible or whatever to the class. So an id has a heavier value than a class so if you add id to the button, and then put #id_name { display:none } in your CSS, the button should be hidden, or apply the style directly on the button