-
Notifications
You must be signed in to change notification settings - Fork 42
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
🐛 Textarea: Skru av autosize ved manuell resize #2518
Conversation
🦋 Changeset detectedLatest commit: 3311a47 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Storybook demoEndringer til review: 1e36974911 | 61 komponenter | 400 stories |
if (inputRef.current?.style.height || inputRef.current?.style.width) { | ||
// User has resized manually | ||
if (inputRef.current?.style.overflow === "hidden") { | ||
setState((oldState) => ({ ...oldState, overflow: false })); |
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 er egentlig litt jalla. Jeg trenger egentlig bare å trigge en rerender, overflow
kan bli satt tilbake til true rett etterpå uansett. Alternativt kan jeg gjøre inputRef.current.style.overflow = undefined
her slik at rerender ikke er nødvendig.
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.
Kan kanskje teste om inputRef.current.style.overflow = undefined
fungerer bedre. Virker som en liten delay før scrollbar dukker opp nå, men er kanskje på grunn av debounce og ikke re-render 🤔
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.
Det er pga. debounce, ja. Tenkte det var unødvendig at handleResize kjørte så ofte ved resize, men kan godt fjerne debounce igjen der.
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.
Tror ikke noen vil merke det, så debounce fungerer fint 👌
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.
Kanskje ikke, men tror ikke det egentlig er nødvendig, og det ser mye smoothere ut når det ikke er forsinkelse.
#2506
Manuell resize overstyrer nå autosize, samt fjerner
overflow:hidden
slik at man får scrollbar ved behov.