Skip to content

Commit

Permalink
set the cursor at end for web, desktop and mweb
Browse files Browse the repository at this point in the history
  • Loading branch information
techievivek committed Sep 15, 2023
1 parent 3a07258 commit 9cfa85f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/PrivateNotes/PrivateNotesEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}}
>
<FullPageNotFoundView
Expand Down

0 comments on commit 9cfa85f

Please sign in to comment.