From 17618d6d657ec059ff9e5eb08bfba25cc6ec01d4 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 2 Mar 2020 12:12:23 +0500 Subject: [PATCH] fix focus on dialog open --- apps/mobile/src/components/AddNotebookDialog/index.js | 4 +--- apps/mobile/src/components/AddTopicDialog/index.js | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.js index 2b9f42cf6..8f0eb627a 100644 --- a/apps/mobile/src/components/AddNotebookDialog/index.js +++ b/apps/mobile/src/components/AddNotebookDialog/index.js @@ -206,9 +206,7 @@ export class AddNotebookDialog extends React.Component { animated animationType="fade" onShow={() => { - setTimeout(() => { - this.titleRef.focus(); - }, 300); + this.titleRef.focus(); }} onRequestClose={this.close}> { @@ -52,6 +53,9 @@ export class AddTopicDialog extends React.Component { animated animationType="fade" transparent={true} + onShow={() => { + this.titleRef.current?.focus(); + }} onRequestClose={() => { refs = []; this.close(); @@ -102,6 +106,7 @@ export class AddTopicDialog extends React.Component {