editor: add input & menu to select different font sizes#9788
Conversation
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
|
Cloudflare Pages Preview https://142aef42.notesnook-app.pages.dev Commit: 8f5e58b |
|
Desktop Previews Commit: 8f5e58b |
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
b94dbc4 to
06e8daf
Compare
| const focusedItem = items[nextIndex]; | ||
| if (focusedItem) onKeyboardFocus?.(focusedItem); |
There was a problem hiding this comment.
I don't fully understand what onKeyboardFocus is for.
There was a problem hiding this comment.
In Google Docs, when we navigate with arrowup/arrowdown in the font sizes menu, it sets the menu item as the input value. I replicated that behavior here.
For that I needed a callback to run when a menu item is focused via a keyboard press i.e. arrowup/arrowdown
There was a problem hiding this comment.
Side effect: up/down keys change the value and if you close the menu by clicking away, it applies the value to the text instead of cancelling/discarding it. The change should only be applied in 2 cases:
- User presses Enter in input
- User clicks/selects a menu item
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
thecodrr
left a comment
There was a problem hiding this comment.
Side effect: up/down keys change the value and if you close the menu by clicking away, it applies the value to the text instead of cancelling/discarding it. The change should only be applied in 2 cases:
- User presses Enter in input
- User clicks/selects a menu item
Updated behavior: ∙ * if input had last interaction, on enter set input value as font size |
Not sure if I understand correctly but won't arrow up/down automatically change the input value? Why do we need special handling for both of these cases? Why can't we just handle the |
|
Oh my bad, looks like I misunderstood. I thought we should remove the input value changing by navigating the menu with arrow up/down. I'll bring that back, and set the input value as font size only if the user hits |
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
bfabeef to
2da7828
Compare
Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
* mobile: set default font size 1-400 Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com> * mobile: Use defined font size bounds Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com> --------- Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
…ont-size-range Add validation in range input selectors

Description
QA Scope
Test on web and mobile.
Type of Change
Visuals
Testing
If tests were not added, explain why
Platform
Sign-off