popovertarget not toggling
@Tom Ireland
No worries ! 🙂 @Tom Ireland
Thanks for the video , @Armand . It looks cool what you 're building ! Regarding the Popover API , my understanding is that popover API attributes are only supported on buttons as long as the button does not submit a form . In that case , the form would be submitted and the popover would not be toggled . The popover would also not be toggled e .g . show /hide if using Prevent default on the click event for a button . In this case , you have your button outside of the form and it 's not tied to it , so using the click event works in your case . I 'd say the best thing to do in this case is to use a click event for the API call as you have done . This should toggle the popover state e .g . show /hide and perform the API call . In most cases , even with a form submit , you 're going to use Prevent default to perform some action and not allow the default browser behaviour (the submit event sets Prevent default by default as well ) , which means you 're going to need your data stored for you API call regardless of submit or click event , so moving it away from a submit event for the form to a click event API call via a workflow will give you the same result and allow you to use popover . Does that make sense ? Use -cases where you might use submit (with Prevent default ) would be for a login form where you submit username and password but then you wouldn 't normally be using popover in those cases . Regarding the button component , you need to create an event inside the component and then when you have a click event on the button component (inside the component ) , trigger the event . This will allow you to use the event on the page level and trigger something else e .g . a workflow with your API call . The event on the component does not have to contain any data - you 're just listening for and triggering the click inside the component in order to then tie an action to it on the page level . See https://docs.nordcraft.com Does that help ?
.jpeg/public)