mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-11 20:58:18 +00:00
Don't close dialogs when a drag ends on the backdrop (#202)
Only close a dialog or command dialog on backdrop click when the press also started on the backdrop, so selecting text inside and releasing outside no longer closes it. Co-authored-by: PhilipdeRijk <derijk.pjtm@gmail.com>
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
class="command-dialog {{ dialog_attrs.class | default('') }}"
|
||||
aria-label="Command menu"
|
||||
{% if open %}open{% endif %}
|
||||
onclick="if (event.target === this) this.close()"
|
||||
onpointerdown="this.dataset.backdropPress = event.target === this" onclick="if (event.target === this && this.dataset.backdropPress === 'true') this.close()"
|
||||
{% for key, value in dialog_attrs.items() %}
|
||||
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
{% if title %}aria-labelledby="{{ id }}-title"{% endif %}
|
||||
{% if description %}aria-describedby="{{ id }}-description"{% endif %}
|
||||
{% if open %}open{% endif %}
|
||||
{% if close_on_overlay_click %}onclick="if (event.target === this) this.close()"{% endif %}
|
||||
{% if close_on_overlay_click %}onpointerdown="this.dataset.backdropPress = event.target === this" onclick="if (event.target === this && this.dataset.backdropPress === 'true') this.close()"{% endif %}
|
||||
{% for key, value in dialog_attrs.items() %}
|
||||
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
class="command-dialog {{ dialog_attrs.class }}"
|
||||
aria-label="Command menu"
|
||||
{% if open %}open{% endif %}
|
||||
onclick="if (event.target === this) this.close()"
|
||||
onpointerdown="this.dataset.backdropPress = event.target === this" onclick="if (event.target === this && this.dataset.backdropPress === 'true') this.close()"
|
||||
{% for key, value in dialog_attrs %}
|
||||
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
{% if title %}aria-labelledby="{{ id }}-title"{% endif %}
|
||||
{% if description %}aria-describedby="{{ id }}-description"{% endif %}
|
||||
{% if open %}open{% endif %}
|
||||
{% if close_on_overlay_click %}onclick="if (event.target === this) this.close()"{% endif %}
|
||||
{% if close_on_overlay_click %}onpointerdown="this.dataset.backdropPress = event.target === this" onclick="if (event.target === this && this.dataset.backdropPress === 'true') this.close()"{% endif %}
|
||||
{% for key, value in dialog_attrs %}
|
||||
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user