Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MaPoKen
Copy link
Contributor

@MaPoKen MaPoKen commented Feb 20, 2025

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 til Legg til steg knappen da den knappen ikke nødvendigvis er der.

@MaPoKen MaPoKen requested a review from a team February 20, 2025 12:45
@katrinewi
Copy link
Contributor

Burde vi også sette fokus til "rediger steg"-knappen når man redigerer et steg og trykker lagre?

@katrinewi
Copy link
Contributor

Og sette fokus til "Legg til nytt steg" når man trykker på "Legg til nytt steg" -> "Avbryt"?


const onOpenCreate = async () => {
setIsCreating(true);
setTimeout(() => document.getElementById("create-step-form")?.getElementsByTagName("input")?.[0]?.focus(), 500);
Copy link
Contributor Author

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?

Copy link
Contributor

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.

@MaPoKen MaPoKen force-pushed the learningpath-step-return-focus-on-delete-and-save branch from bb765cc to c41822d Compare February 25, 2025 13:21
@@ -93,3 +93,5 @@ export const formValuesToGQLInput = (values: FormValues) => {
};

export const learningpathListItemId = (id: number) => `learningpath-${id}`;

export const learningpathStepListItemId = (id: number) => `learningpathstep-${id}`;
Copy link
Contributor

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);
Copy link
Contributor

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

@MaPoKen MaPoKen requested a review from Jonas-C February 28, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants