Skip to content

Commit

Permalink
Fix address input cursor behaviour (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
zerts authored Aug 16, 2024
1 parent 59acff3 commit 869f2c7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ui/pages/SendForm/fieldsets/AddressInput/AddressInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,6 @@ export function AddressInput({
getItemId: (index) =>
items[index] ? `${items[index]?.groupType}-${items[index]?.address}` : '',
itemToString: (item) => (item ? getTitle(item) : ''),
onInputValueChange: ({ inputValue }) => {
setShowAllItems(false);
onChange(inputValue ?? '');
},
onSelectedItemChange: ({ selectedItem }) => {
if (!selectedItem) {
return;
Expand Down Expand Up @@ -357,9 +353,15 @@ export function AddressInput({
</UnstyledButton>
<UIText kind="headline/h3">
<UnstyledInput
autoFocus={autoFocus}
{...getInputProps({
...inputProps,
// use onChange instead of onInputValueChange for controlled inputs
// https://github.com/downshift-js/downshift/issues/1108#issuecomment-674180157
onChange: (e) => {
setShowAllItems(false);
onChange(e.currentTarget.value ?? '');
},
autoFocus,
placeholder: 'Address, domain or identity',
style: { width: '100%' },
})}
Expand Down

0 comments on commit 869f2c7

Please sign in to comment.