-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51516 from bernhardoj/fix/50962-exit-survey-page-…
…auto-validate-when-open Fix exit survey response page validation runs when open
- Loading branch information
Showing
5 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type {MoveSelectiontoEnd, ScrollToBottom} from './types'; | ||
|
||
const scrollToBottom: ScrollToBottom = () => {}; | ||
const moveSelectionToEnd: MoveSelectiontoEnd = () => {}; | ||
|
||
export {scrollToBottom, moveSelectionToEnd}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type {MoveSelectiontoEnd, ScrollToBottom} from './types'; | ||
|
||
const scrollToBottom: ScrollToBottom = (input) => { | ||
if (!('scrollTop' in input)) { | ||
return; | ||
} | ||
// eslint-disable-next-line no-param-reassign | ||
input.scrollTop = input.scrollHeight; | ||
}; | ||
|
||
const moveSelectionToEnd: MoveSelectiontoEnd = (input) => { | ||
if (!('setSelectionRange' in input)) { | ||
return; | ||
} | ||
const length = input.value.length; | ||
input.setSelectionRange(length, length); | ||
}; | ||
|
||
export {scrollToBottom, moveSelectionToEnd}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type {TextInput} from 'react-native'; | ||
|
||
type ScrollToBottom = (input: HTMLInputElement | TextInput) => void; | ||
type MoveSelectiontoEnd = (input: HTMLInputElement | TextInput) => void; | ||
|
||
export type {ScrollToBottom, MoveSelectiontoEnd}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters