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

Comments

Projects
None yet
4 participants
@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 label Feb 20, 2019

@earnjam

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

designsimply commented Feb 20, 2019

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

@earnjam

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

aduth commented Feb 20, 2019

Fix proposed at #13986

@aduth aduth closed this in #13986 Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.