-
Notifications
You must be signed in to change notification settings - Fork 535
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
Avoid calling getCharacterCoordinates
when fullHeight
is set in the MarkdownEditor
#3423
Conversation
🦋 Changeset detectedLatest commit: 718e28e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
@@ -4,6 +4,7 @@ import {SxProp} from '../../sx' | |||
import {getCharacterCoordinates} from '../utils/character-coordinates' | |||
|
|||
type UseDynamicTextareaHeightSettings = { | |||
fullHeight?: boolean |
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.
Maybe we should just call this disabled
or something generic like that? This hook isn't specific to the Markdown editor - it can be used to size any textarea - but fullHeight
is.
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.
Good point, done in 718e28e
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.
I know it's still draft, but looks good 🙂
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.
@japf - could you add a Storybook example for this behavior in src/drafts/MarkdownEditor/MarkdownEditor.stories.tsx
?
👋 @mperrotti it looks like when this is enabled, we can see there are no calls to |
Uh oh! @japf, the image you shared is missing helpful alt text. Check #3423 (comment). Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs. |
1 similar comment
Uh oh! @japf, the image you shared is missing helpful alt text. Check #3423 (comment). Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs. |
This fixes a performance issue where on each keystroke
getCharacterCoordinates
is called in the markdown editor.When
fullHeight
is set to true, we can skip this call and save some cpu cycles 🚀Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.