Skip to content

Commit 75579f3

Browse files
authored
fix(#24034): add unselectable for ie11; (#487)
1 parent c864869 commit 75579f3

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/Selector/Input.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const Input: React.RefForwardingComponent<InputRef, InputProps> = (
7272
'aria-activedescendant': `${id}_list_${accessibilityIndex}`,
7373
value: editable ? value : '',
7474
readOnly: !editable,
75+
unselectable: !editable ? 'on' : null,
7576
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => {
7677
onKeyDown(event);
7778
if (onOriginKeyDown) {

tests/__snapshots__/Multiple.test.tsx.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports[`Select.Multiple render not display maxTagPlaceholder if maxTagCount not
2323
readonly=""
2424
role="combobox"
2525
style="opacity: 0;"
26+
unselectable="on"
2627
value=""
2728
/>
2829
<span
@@ -115,6 +116,7 @@ exports[`Select.Multiple render truncates tags by maxTagCount and show maxTagPla
115116
readonly=""
116117
role="combobox"
117118
style="opacity: 0;"
119+
unselectable="on"
118120
value=""
119121
/>
120122
<span
@@ -204,6 +206,7 @@ exports[`Select.Multiple render truncates tags by maxTagCount and show maxTagPla
204206
readonly=""
205207
role="combobox"
206208
style="opacity: 0;"
209+
unselectable="on"
207210
value=""
208211
/>
209212
<span
@@ -282,6 +285,7 @@ exports[`Select.Multiple render truncates values by maxTagTextLength 1`] = `
282285
readonly=""
283286
role="combobox"
284287
style="opacity: 0;"
288+
unselectable="on"
285289
value=""
286290
/>
287291
<span

tests/__snapshots__/Select.test.tsx.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exports[`Select.Basic does not filter when filterOption value is false 1`] = `
2222
readonly=""
2323
role="combobox"
2424
style="opacity:0"
25+
unselectable="on"
2526
value=""
2627
/>
2728
</span>
@@ -195,6 +196,7 @@ exports[`Select.Basic no search 1`] = `
195196
readonly=""
196197
role="combobox"
197198
style="opacity:0"
199+
unselectable="on"
198200
value=""
199201
/>
200202
</span>
@@ -240,6 +242,7 @@ exports[`Select.Basic render renders aria-attributes correctly 1`] = `
240242
readonly=""
241243
role="combobox"
242244
style="opacity:0"
245+
unselectable="on"
243246
value=""
244247
/>
245248
</span>
@@ -295,6 +298,7 @@ exports[`Select.Basic render renders correctly 1`] = `
295298
readonly=""
296299
role="combobox"
297300
style="opacity:0"
301+
unselectable="on"
298302
value=""
299303
/>
300304
</span>
@@ -352,6 +356,7 @@ exports[`Select.Basic render renders data-attributes correctly 1`] = `
352356
readonly=""
353357
role="combobox"
354358
style="opacity:0"
359+
unselectable="on"
355360
value=""
356361
/>
357362
</span>
@@ -409,6 +414,7 @@ exports[`Select.Basic render renders disabled select correctly 1`] = `
409414
readonly=""
410415
role="combobox"
411416
style="opacity:0"
417+
unselectable="on"
412418
value=""
413419
/>
414420
</span>
@@ -627,6 +633,7 @@ exports[`Select.Basic render renders role prop correctly 1`] = `
627633
readonly=""
628634
role="combobox"
629635
style="opacity:0"
636+
unselectable="on"
630637
value=""
631638
/>
632639
</span>
@@ -683,6 +690,7 @@ exports[`Select.Basic should contain falsy children 1`] = `
683690
readonly=""
684691
role="combobox"
685692
style="opacity:0"
693+
unselectable="on"
686694
value=""
687695
/>
688696
</span>
@@ -811,6 +819,7 @@ exports[`Select.Basic should render custom dropdown correctly 1`] = `
811819
readonly=""
812820
role="combobox"
813821
style="opacity: 0;"
822+
unselectable="on"
814823
value=""
815824
/>
816825
</span>

0 commit comments

Comments
 (0)