Click outside the blue box to trigger the clickaway event.
Clicking inside this box will NOT trigger the clickaway event. Clicking outside will trigger it.
Click the button to open the menu, then click outside to close it.
Open the modal and click outside the white area to close it.
Test different mouse and touch events.
Triggers on mousedown outside
Triggers on mouseup outside
Toggle the disabled state to control click away detection.
This listener is disabled and won't trigger clickaway events.
Test the programmatic createClickAwayListener function.
This uses the programmatic API instead of the web component.