mirror of
https://github.com/lowdefy/lowdefy.git
synced 2024-11-27 05:12:31 +08:00
feat: add condition to allow more input types
This commit is contained in:
parent
1636018a86
commit
d8989be10f
@ -77,7 +77,23 @@ const TextInput = ({
|
||||
const cStart = event.target.selectionStart;
|
||||
const cEnd = event.target.selectionEnd;
|
||||
runAfterUpdate(() => {
|
||||
event.target.setSelectionRange(cStart, cEnd);
|
||||
// Allows for input types that don't support SelectionRange
|
||||
if (
|
||||
![
|
||||
'email',
|
||||
'date',
|
||||
'datetime-local',
|
||||
'month',
|
||||
'number',
|
||||
'time',
|
||||
'week',
|
||||
'range',
|
||||
'color',
|
||||
'file',
|
||||
].includes(properties.type)
|
||||
) {
|
||||
event.target.setSelectionRange(cStart, cEnd);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user