Skip to content

Commit db923b8

Browse files
committed
hasSelectionCapabilities: email, tel and url input-fields can have selections too (fixes problem when input field changes type on dynamically)
1 parent 4ca7855 commit db923b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-dom/src/client/ReactInputSelection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export function hasSelectionCapabilities(elem) {
2626
const nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
2727
return (
2828
nodeName &&
29-
((nodeName === 'input' && elem.type === 'text') ||
29+
((nodeName === 'input' && (
30+
elem.type === 'text' || elem.type == "email" || elem.type == "tel" || elem.type == "url")
31+
) ||
3032
nodeName === 'textarea' ||
3133
elem.contentEditable === 'true')
3234
);

0 commit comments

Comments
 (0)