-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return focus on delete and save steps #2370
base: master
Are you sure you want to change the base?
Conversation
Burde vi også sette fokus til "rediger steg"-knappen når man redigerer et steg og trykker lagre? |
Og sette fokus til "Legg til nytt steg" når man trykker på "Legg til nytt steg" -> "Avbryt"? |
…gpath-step-return-focus-on-delete-and-save
|
||
const onOpenCreate = async () => { | ||
setIsCreating(true); | ||
setTimeout(() => document.getElementById("create-step-form")?.getElementsByTagName("input")?.[0]?.focus(), 500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dette var eneste løsningen jeg kom på for å håndtere lazy loadingen av komponenten? Er det kanskje mulig å lazyloade kun richTextEditor? Eller var det dumt å gjøre?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nei, det holder dessverre ikke å kun lazyloade RichTextEditor. Serialisering og deserialisering skjer utenfor RichTextEditor, og drar inn alt av slate-pakker.
bb765cc
to
c41822d
Compare
…gpath-step-return-focus-on-delete-and-save
@@ -93,3 +93,5 @@ export const formValuesToGQLInput = (values: FormValues) => { | |||
}; | |||
|
|||
export const learningpathListItemId = (id: number) => `learningpath-${id}`; | |||
|
|||
export const learningpathStepListItemId = (id: number) => `learningpathstep-${id}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disse er litt vanskelig å skille mellom synes jeg. Kunne vi renamet de?
|
||
const onOpenCreate = async () => { | ||
setIsCreating(true); | ||
setTimeout(() => document.getElementById("create-step-form")?.querySelector("input")?.focus(), 500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dette burde være consts
Setter nå fokuset til å gå til rediger knappene når du sletter/lager nytt steg.
Om du sletter og det ikke er noen andre steg i listen så settes den til
SKIP_TO_CONTENT
, velger å ikke sette den tilLegg til steg
knappen da den knappen ikke nødvendigvis er der.