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

Entire block's content deleted on single backspace in Firefox when the plugin is active #13979

Closed
cdevroe opened this issue Feb 20, 2019 · 8 comments · Fixed by #13986
Closed
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@cdevroe
Copy link

cdevroe commented Feb 20, 2019

Describe the bug
Clicking backspace to delete a single character results in an entire block's content being removed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to A New Post with the Gutenberg Editor
  2. Begin typing anything into the empty block
  3. Hit backspace
  4. Entire block's content deleted.

Expected behavior
I would expect for a single character to be deleted.

Desktop (please complete the following information):

  • OS: Windows 10 Version 1809 Build 17763.316
  • Browser: Firefox
  • Version: 65.0

Additional context

  • Gutenberg 5.1.0
  • WordPress 5.0.3
  • Firefox extensions: 1Password, LastPass, Inoreader
@designsimply designsimply changed the title Entire block's content deleted on single backspace in Firefox Entire block's content deleted on single backspace in Firefox when the plugin is active Feb 20, 2019
@earnjam earnjam added the [Type] Bug An existing feature does not function as intended label Feb 20, 2019
@earnjam
Copy link
Contributor

earnjam commented Feb 20, 2019

After a git bisect, It appears that this was introduced in c17239f

Sorry, I started with a bad commit on this, so it's sometime earlier than that.

What I missed in further testing is that it is only when typing in a new block. Once you move focus away from the block and come back, you can delete single characters at a time.

@designsimply
Copy link
Member

designsimply commented Feb 20, 2019

Tested and confirmed using WordPress 5.0.3 and Gutenberg 5.1.0 hosted at https://jurassic.ninja/ using Firefox 65.0 on macOS 10.13.6.

Note: this problem only happens when the plugin is active and only in Firefox.

13979-5s

Console log is getting the following error, looks like for every key press:

TypeError: t is undefined index.js:50:162547

cc @iseulde

@designsimply designsimply added Browser Issues Issues or PRs that are related to browser specific problems [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Priority] High Used to indicate top priority items that need quick attention labels Feb 20, 2019
@designsimply
Copy link
Member

@earnjam c17239f should only affect the native mobile apps if I understand correctly.

@earnjam
Copy link
Contributor

earnjam commented Feb 20, 2019

@earnjam c17239f should only affect the native mobile apps if I understand correctly.

Yep, sorry updated my comment above. I discovered some specific circumstances of the issue that made it appear the commit before that was working.

@aduth
Copy link
Member

aduth commented Feb 20, 2019

Error occurs at this line:

inputType.indexOf( 'format' ) === 0 ||

TypeError: inputType is undefined[Learn More]

Quite likely related to changes introduced as part of #13833 (cc @iseulde @noisysocks )

@aduth
Copy link
Member

aduth commented Feb 20, 2019

Per the following, only Chrome and Safari have support for InputEvent#inputType:

https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType#Browser_compatibility

@aduth
Copy link
Member

aduth commented Feb 20, 2019

A not-so-great "workaround" (more to the point of confirming the above) is to enter this in your browser console when loading the editor:

window.addEventListener( 'input', ( e ) => e.inputType = '', true )

@aduth
Copy link
Member

aduth commented Feb 20, 2019

Fix proposed at #13986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants