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

Allow pressing ENTER to change Reusable Block name #3993

Merged
merged 2 commits into from Jan 2, 2018

Conversation

Projects
None yet
3 participants
@noisysocks
Member

noisysocks commented Dec 14, 2017

When the Reusable Block name field is focused, pressing ENTER should save the block. Similarly, pressing ESCAPE should cancel editing the block.

enter-to-save-block

@noisysocks noisysocks added the Blocks label Dec 14, 2017

@noisysocks noisysocks requested a review from jasmussen Dec 14, 2017

@jasmussen

This comment has been minimized.

Show comment
Hide comment
@jasmussen

jasmussen Dec 14, 2017

Contributor

I dig it! 👍 👍

Contributor

jasmussen commented Dec 14, 2017

I dig it! 👍 👍

@aduth

It seems like we could improve this by handling the panel as a proper form element, and binding to the submit event, which would fire both for <button type="submit" /> or while pressing enter within an input. What do you think? Not always a fan of explicitly handling specific key codes when there's an alternative browser default behavior available.

@noisysocks

This comment has been minimized.

Show comment
Hide comment
@noisysocks

noisysocks Dec 14, 2017

Member

Makes sense! Updated this to use a <form>.

Member

noisysocks commented Dec 14, 2017

Makes sense! Updated this to use a <form>.

noisysocks added some commits Dec 14, 2017

Allow pressing ENTER to change Reusable Block name
When the Reusable Block name field is focused, pressing ENTER should
save the block. Similarly, pressing ESCAPE should cancel editing the
block.
Fix React warning
Elements in this returned array require a key= attribute.
@noisysocks

This comment has been minimized.

Show comment
Hide comment
@noisysocks

noisysocks Jan 2, 2018

Member

How's this looking, @aduth? 🙂

Member

noisysocks commented Jan 2, 2018

How's this looking, @aduth? 🙂

@aduth

aduth approved these changes Jan 2, 2018

Apologies for the delay here, as I've been away from the computer the better part of the past two weeks. Took another look and appears / works great 👍

Not related to these changes, but one usability issue with reusable blocks is that deselecting a block doesn't cancel the reusable block's isEditing flag. Do you find this to be unexpected?

@noisysocks

This comment has been minimized.

Show comment
Hide comment
@noisysocks

noisysocks Jan 2, 2018

Member

Thanks Andrew!

Not related to these changes, but one usability issue with reusable blocks is that deselecting a block doesn't cancel the reusable block's isEditing flag. Do you find this to be unexpected?

Nice catch. I'll note this for later 😄

Member

noisysocks commented Jan 2, 2018

Thanks Andrew!

Not related to these changes, but one usability issue with reusable blocks is that deselecting a block doesn't cancel the reusable block's isEditing flag. Do you find this to be unexpected?

Nice catch. I'll note this for later 😄

@noisysocks noisysocks merged commit b82e4c0 into master Jan 2, 2018

3 checks passed

codecov/project 39.15% (-0.02%) compared to 976f8c6
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@noisysocks noisysocks deleted the fix/allow-pressing-enter-to-change-reusable-block-name branch Jan 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment