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

fix: support updating stroke color for text by typing in color picker input #4415

Merged
merged 4 commits into from
Dec 17, 2021

Conversation

ad1992
Copy link
Member

@ad1992 ad1992 commented Dec 17, 2021

This has been an existing issue for text editor
Before
Excalidraw (20)
Now
Excalidraw (21)

@vercel
Copy link

vercel bot commented Dec 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/6WkUieoibyL4uHWY41qyR64buEsR
✅ Preview: https://excalidraw-git-aakansha-cp-excalidraw.vercel.app

@ad1992 ad1992 requested a review from dwelle December 17, 2021 07:12
@dwelle
Copy link
Member

dwelle commented Dec 17, 2021

Oh yes, I noticed that just yesterday as well! 👍

Comment on lines 491 to 492
// case: clicking on the same property → no change → no update → no focus
editable.focus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one still needs to be there. Does the fix not work while keeping this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the editor gets focussed so typing gets reflected on editor instead, I am not sure why do we need this ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you click on an already selected button (e.g. you double-click on the same font button, or you open & close the color picker) there's no update which would trigger programmatic focus:

const unbindUpdate = Scene.getScene(element)!.addCallback(() => {
updateWysiwygStyle();
editable.focus();
});

Don't recall why the pointerdown preventing on the island isn't enough.

@dwelle
Copy link
Member

dwelle commented Dec 17, 2021

There's a strange behavior (likely relating to updates) where once you type a valid color into the HEX input, it blurs it 😄

@ad1992
Copy link
Member Author

ad1992 commented Dec 17, 2021

There's a strange behavior (likely relating to updates) where once you type a valid color into the HEX input, it blurs it 😄

fixed

@ad1992 ad1992 merged commit 8b5657e into master Dec 17, 2021
@ad1992 ad1992 deleted the aakansha-cp branch December 17, 2021 14:45
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.

None yet

2 participants