alpinejs / alpine

A rugged, minimal framework for composing JavaScript behavior in your markup.
https://alpinejs.dev
MIT License
27.92k stars 1.22k forks source link

Add 'panelWithoutClose' to Dialogs #4193

Closed kzipp closed 4 months ago

kzipp commented 4 months ago

The hope here is to keep a dialog/modal open when clicking outside of the panel.

Not a default or breaking change, just another option.

I added an additional directive of panelWithoutClose, cloned the handlePanel function, and removed the @click.outside line from it.

ekwoka commented 4 months ago

This can be implemented as a modifier like .noclose would probably be more inline with how Alpine works elsewhere

also, directives can't have capitals. attributes in normal HTML are all lowercase.