Skip to content

Commit

Permalink
fix(llm): 🐛 focus the memo tag input after clicking "Add Tag" (#8627)
Browse files Browse the repository at this point in the history
* fix(llm): focus the memo tag input after clicking "Add Tag"

* fix(llm): do not lose the input focus randomly

* fix(llm): focus on the Stellar memo input too
  • Loading branch information
thesan authored Dec 12, 2024
1 parent 9820a8f commit 4b8e87d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smart-olives-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Focus on the memo tag input when clicking the drawers "Add Tag" button
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AnimatedInputSelect } from "@ledgerhq/native-ui";
import type { MemoTagInputProps } from "LLM/features/MemoTag/types";
import { MemoTypeDrawer, MEMO_TYPES } from "./MemoTypeDrawer";

export default ({ onChange }: MemoTagInputProps<StellarTransaction>) => {
export default ({ onChange, ...inputProps }: MemoTagInputProps<StellarTransaction>) => {
const { t } = useTranslation();

const [memoType, setMemoType] = useState<MemoType>("NO_MEMO");
Expand Down Expand Up @@ -43,6 +43,7 @@ export default ({ onChange }: MemoTagInputProps<StellarTransaction>) => {
return (
<>
<AnimatedInputSelect
{...inputProps}
placeholder={t("send.summary.memo.value")}
value={memoValue}
onChange={handleChangeValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export default function SendSelectRecipient({ navigation, route }: Props) {
<memoTag.Input
testID="memo-tag-input"
placeholder={t("send.summary.memo.title")}
autoFocus={memoTagDrawerState !== MemoTagDrawerState.INITIAL}
onChange={memoTag.handleChange}
/>
<Text mt={4} pl={2} color="alert">
Expand Down

0 comments on commit 4b8e87d

Please sign in to comment.