Skip to content

Commit 99e94d1

Browse files
committed
fix: stop propagation when revealing passwords in admin tables so it doesn't navigate
1 parent 364d8a3 commit 99e94d1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/coalesce-vue-vuetify3/src/components/display/c-display.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ const passwordWrapper = defineComponent({
3232
role: "button",
3333
pressed: this.shown,
3434
title: !this.shown ? "Reveal" : "Hide",
35-
onClick: () => (this.shown = !this.shown),
35+
onClick: (ev) => {
36+
this.shown = !this.shown;
37+
ev.stopPropagation();
38+
},
3639
}),
3740
!this.shown ? "".repeat(8) : this.value,
38-
]
41+
],
3942
);
4043
},
4144
});
@@ -126,7 +129,7 @@ function render() {
126129
127130
if (!meta) {
128131
throw Error(
129-
"Provided model has no $metadata property, and no specific value was provided via the 'for' component prop to c-display."
132+
"Provided model has no $metadata property, and no specific value was provided via the 'for' component prop to c-display.",
130133
);
131134
}
132135
@@ -157,7 +160,7 @@ function render() {
157160
...attrs,
158161
style: "white-space: pre-wrap",
159162
},
160-
valueString || slots
163+
valueString || slots,
161164
);
162165
163166
case "url-image":
@@ -177,12 +180,12 @@ function render() {
177180
h("span", {
178181
style: `background-color: ${valueString.replace(
179182
/[^A-Fa-f0-9#]/g,
180-
""
183+
"",
181184
)};`,
182185
class: "c-display--color-swatch",
183186
}),
184187
valueString || slots,
185-
] as any
188+
] as any,
186189
);
187190
188191
case "url":
@@ -205,7 +208,7 @@ function render() {
205208
...attrs,
206209
href,
207210
},
208-
valueString
211+
valueString,
209212
);
210213
} catch {
211214
/* value is not a valid url */

0 commit comments

Comments
 (0)