Skip to content

Commit 7fe5c4c

Browse files
committed
Always a[href]
Fixes #14751
1 parent a96182e commit 7fe5c4c

7 files changed

Lines changed: 8 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- Fixed a bug where the “Utilities” global nav item could get two badge counts.
2121
- Fixed a bug where custom fields whose previous types were missing would lose their values when updating to Craft 5.
2222
- Fixed a bug where Dropdown fields could be marked as invalid on save, if the saved value was invalid and they were initially marked as changed (to the default value) on page load. ([#14738](https://github.com/craftcms/cms/pull/14738))
23+
- Fixed a bug where double-clicking on an element’s label within an element selection modal wasn’t selecting the element. ([#14751](https://github.com/craftcms/cms/issues/14751))
2324

2425
## 5.0.0 - 2024-03-26
2526

src/web/assets/cp/dist/cp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/dist/cp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/src/js/BaseElementIndexView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
5959
multi: this.settings.multiSelect,
6060
vertical: this.isVerticalList(),
6161
filter: (target) => {
62-
return !$(target).closest('a,.toggle,.btn').length;
62+
return !$(target).closest('a[href],.toggle,.btn').length;
6363
},
6464
checkboxMode: this.settings.checkboxMode,
6565
onSelectionChange: this.onSelectionChange.bind(this),
@@ -83,7 +83,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
8383
// Enable inline element editing if this is an index page
8484
if (this.elementIndex.isAdministrative) {
8585
this._handleElementEditing = (ev) => {
86-
if ($(ev.target).closest('a,button').length) {
86+
if ($(ev.target).closest('a[href],button').length) {
8787
// Let the link/button do its thing
8888
return;
8989
}

src/web/assets/cp/src/js/BaseElementSelectInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Craft.BaseElementSelectInput = Garnish.Base.extend(
139139
return {
140140
multi: this.settings.sortable,
141141
filter: (target) => {
142-
return !$(target).closest('a,button').length;
142+
return !$(target).closest('a[href],button').length;
143143
},
144144
// prevent keyboard focus since element selection is only needed for drag-n-drop
145145
makeFocusable: false,

src/web/assets/cp/src/js/ComponentSelectInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Craft.ComponentSelectInput = Garnish.Base.extend(
114114
this.componentSelect = new Garnish.Select({
115115
multi: this.settings.sortable,
116116
filter: (target) => {
117-
return !$(target).closest('a,button').length;
117+
return !$(target).closest('a[href],button').length;
118118
},
119119
// prevent keyboard focus since component selection is only needed for drag-n-drop
120120
makeFocusable: false,

src/web/assets/cp/src/js/NestedElementManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ Craft.NestedElementManager = Garnish.Base.extend(
382382
initElement($element) {
383383
if (Garnish.hasAttr($element, 'data-editable')) {
384384
this.addListener($element, 'dblclick,taphold', (ev) => {
385-
if ($(ev.target).closest('a,button').length) {
385+
if ($(ev.target).closest('a[href],button').length) {
386386
// Let the link/button do its thing
387387
return;
388388
}

0 commit comments

Comments
 (0)