From f28ed3613642e498805fbc5adf3b7e79a9dfdb3d Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Thu, 29 Sep 2022 20:43:44 +0530 Subject: [PATCH] fix: disable spellcheck on custom note title format fix: open title format help page in new tab/window --- .../General/Defaults/CustomNoteTitleFormat.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/General/Defaults/CustomNoteTitleFormat.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/General/Defaults/CustomNoteTitleFormat.tsx index 8fbb1a334..995206c80 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/General/Defaults/CustomNoteTitleFormat.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/General/Defaults/CustomNoteTitleFormat.tsx @@ -12,6 +12,8 @@ type Props = { const PrefChangeDebounceTimeInMs = 25 +const HelpPageUrl = 'https://day.js.org/docs/en/display/format#list-of-all-available-formats' + const CustomNoteTitleFormat = ({ application }: Props) => { const [customNoteTitleFormat, setCustomNoteTitleFormat] = useState(() => application.getPreference(PrefKey.CustomNoteTitleFormat, PrefDefaults[PrefKey.CustomNoteTitleFormat]), @@ -42,7 +44,17 @@ const CustomNoteTitleFormat = ({ application }: Props) => { Custom Note Title Format All available date-time formatting options can be found{' '} - + { + if (application.isNativeMobileWeb()) { + event.preventDefault() + application.mobileDevice.openUrl(HelpPageUrl) + } + }} + > here . Use square brackets ([]) to escape date-time formatting. @@ -54,6 +66,7 @@ const CustomNoteTitleFormat = ({ application }: Props) => { value={customNoteTitleFormat} onChange={handleInputChange} onBlur={setCustomNoteTitleFormatPreference} + spellCheck={false} />