Skip to content

Commit a5351b9

Browse files
committed
Remove unneeded data- attribute for ComboBox input
1 parent 47c9a48 commit a5351b9

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/components/ComboBox/ComboBox.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default function ComboBox<ComboBoxOption extends ComboBoxItem>({
132132
</label>
133133
<div className="Draftail-ComboBox__field">
134134
<input
135-
data-draftail-command-palette-input
136135
type="text"
137136
{...getInputProps()}
138137
// Prevent the field from receiving focus if it’s not visible.

src/components/CommandPalette/CommandPalette.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export const simulateInputEvent = (
2828
if (!editor) {
2929
return;
3030
}
31-
const input = editor.querySelector<HTMLInputElement>(
32-
"[data-draftail-command-palette-input]",
33-
);
31+
const input = editor.querySelector<HTMLInputElement>('[role="combobox"]');
3432
if (!input) {
3533
return;
3634
}

src/components/Toolbar/BlockToolbar/BlockToolbar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ const BlockToolbar = ({
149149
zIndex={tooltipZIndex}
150150
showBackdrop={showBackdrop}
151151
onMount={(instance: PopperInstance) => {
152-
const field = instance.popper.querySelector<HTMLInputElement>(
153-
"[data-draftail-command-palette-input]",
154-
);
152+
const field =
153+
instance.popper.querySelector<HTMLInputElement>(
154+
'[role="combobox"]',
155+
);
155156
if (field) {
156157
field.focus();
157158
}

0 commit comments

Comments
 (0)