mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-27 09:53:13 +00:00
Merge pull request #5789 from overleaf/hb-fix-cursor-jump-share-modal
Prevent cursor jumping in share modal input GitOrigin-RevId: e3c88e4ff91bc9a83e8ac781305d0a34f198911c
This commit is contained in:
parent
dd733fda84
commit
7c186082ef
1 changed files with 3 additions and 5 deletions
|
@ -84,11 +84,6 @@ export default function SelectCollaborators({
|
|||
itemToString: item => item && item.name,
|
||||
onStateChange: ({ inputValue, type, selectedItem }) => {
|
||||
switch (type) {
|
||||
// set inputValue when the input changes
|
||||
case useCombobox.stateChangeTypes.InputChange:
|
||||
setInputValue(inputValue)
|
||||
break
|
||||
|
||||
// add a selected item on Enter (keypress), click or blur
|
||||
case useCombobox.stateChangeTypes.InputKeyDownEnter:
|
||||
case useCombobox.stateChangeTypes.ItemClick:
|
||||
|
@ -177,6 +172,9 @@ export default function SelectCollaborators({
|
|||
addNewItem(inputValue, false)
|
||||
}
|
||||
},
|
||||
onChange: e => {
|
||||
setInputValue(e.target.value)
|
||||
},
|
||||
onKeyDown: event => {
|
||||
switch (event.key) {
|
||||
case 'Enter':
|
||||
|
|
Loading…
Reference in a new issue