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

[CLOSED] Update color picker when user makes edits in host editor #2068

Open
core-ai-bot opened this issue Aug 29, 2021 · 6 comments
Open

[CLOSED] Update color picker when user makes edits in host editor #2068

core-ai-bot opened this issue Aug 29, 2021 · 6 comments

Comments

@core-ai-bot
Copy link
Member

Issue by njx
Sunday Nov 18, 2012 at 22:21 GMT
Originally opened as adobe/brackets#2147


In addition to that behavior change, I also factored out logic for getting the current host editor range associated with the inline editor. I also tweaked that logic to make it a little more robust to host edits--if the end bookmark goes stale, instead of just assuming that the relevant range still corresponds to the original color length, we first re-check the color regex to try to determine the end.

Note that this is currently independent of #2142. We might want to reuse the logic from that pull request that avoids synchronizing when the text input field contains an invalid color value, and apply that to changes from the host editor as well. However, this pull could be reviewed independently of that, and we could merge the implementations later; the change would be to make handleHostEditorChange() call that factored-out logic instead of directly calling commitColor().


njx included the following code: https://github.com/adobe/brackets/pull/2147/commits

@core-ai-bot
Copy link
Member Author

Comment by njx
Monday Nov 19, 2012 at 18:26 GMT


Assigning to@peterflynn

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Nov 20, 2012 at 02:01 GMT


OK, this should be ready for review. Note that in the scenario in #2140, we now collapse the editor. I had originally made it so that we would keep the editor open on the chance that the user might make the color valid again (and correctly update the range in that case), but since we can't really tell whether the user is going to do that in the future, it seems safer to just collapse the editor immediately. We could try to make some smarter UI for this in the future.

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Nov 20, 2012 at 20:06 GMT


Fixes pushed, ready for re-review.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Nov 20, 2012 at 20:34 GMT


Done reviewing.

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Nov 20, 2012 at 21:41 GMT


Updates pushed.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Nov 20, 2012 at 22:25 GMT


Cool, looks good then

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

No branches or pull requests

1 participant