Expensify / react-native-live-markdown

Drop-in replacement for React Native's TextInput component with Markdown formatting.
https://www.npmjs.com/package/@expensify/react-native-live-markdown
MIT License
670 stars 45 forks source link

Auto focus only on mount #362

Closed bernhardoj closed 1 month ago

bernhardoj commented 1 month ago

Details

Removed autoFocus from the useEffect deps so it only auto focus on mount.

Related Issues

https://github.com/Expensify/App/issues/42645

Manual Tests

  1. Add an autoFocus state to the example app
  2. Add a new button to toggle the state
  3. Press the button to toggle the state
  4. If the state is true, verify the input isn't focused

Before:

https://github.com/Expensify/react-native-live-markdown/assets/50919443/74f976c0-5c3b-46d8-aeb3-80099ccba400

After:

https://github.com/Expensify/react-native-live-markdown/assets/50919443/18330d30-1e78-4a57-9b3a-909f52895b0b

tomekzaw commented 1 month ago

@bernhardoj Thanks for the PR!

LGTM but let's wait for @Skalakid's or @BartoszGrajdek's approval prior to merging.