Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

GDGT-3230 fix lack of highlight in CardEmbedNode title input (#82520)

Will Fry6faa93e40c28
diff --git a/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/CardEmbedNode.module.css b/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/CardEmbedNode.module.css
index 037195500c4..b90bbd4c66a 100644
--- a/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/CardEmbedNode.module.css
+++ b/frontend/src/metabase/documents/components/editor-extensions/CardEmbed/CardEmbedNode.module.css
@@ -26,13 +26,19 @@
outline: none;
}
-.cardEmbed * {
+.cardEmbed *:not(input, textarea) {
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
+/* ProseMirror hides selections while the card is node-selected (.ProseMirror-hideselection) */
+.cardEmbed input::selection {
+ background-color: Highlight;
+ color: HighlightText;
+}
+
/* Firefox doesn't respect `user-select: none` when inside a contenteditable element. */
.cardEmbed *:not(input, textarea)::selection {
background: transparent;