From 9cfa85ff753c5d1cbf432ccef59e2f8eb63ef46b Mon Sep 17 00:00:00 2001 From: Vivek Kumar Date: Fri, 15 Sep 2023 15:52:40 +0530 Subject: [PATCH] set the cursor at end for web, desktop and mweb --- src/pages/PrivateNotes/PrivateNotesEditPage.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/PrivateNotes/PrivateNotesEditPage.js b/src/pages/PrivateNotes/PrivateNotesEditPage.js index f909239a2b48..70afebb3d5bf 100644 --- a/src/pages/PrivateNotes/PrivateNotesEditPage.js +++ b/src/pages/PrivateNotes/PrivateNotesEditPage.js @@ -83,6 +83,12 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) { } privateNotesInput.current.focus(); + + // Below condition is needed for web, desktop and mweb only, for native cursor to position at end by default. + if (privateNotesInput.current.value && privateNotesInput.current.setSelectionRange) { + const length = privateNotesInput.current.value.length; + privateNotesInput.current.setSelectionRange(length, length); + } }} >