Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Inconsistent Ctrl-Z Behavior in Chrome #86

Open
1 of 8 tasks
wyattallen opened this issue Jul 29, 2016 · 10 comments
Open
1 of 8 tasks

Inconsistent Ctrl-Z Behavior in Chrome #86

wyattallen opened this issue Jul 29, 2016 · 10 comments

Comments

@wyattallen
Copy link

wyattallen commented Jul 29, 2016

Inconsistent Ctrl-Z Behavior in Chrome

Expected outcome

When typing out text in an iron-autogrow-textarea Ctrl-Z command removes batches of text content per keypress. (Not individual characters.)

Actual outcome

Using Ctrl-Z in iron-autogrow-textarea elements inconsistently only undoes one character at a time (particularly when there is more than one line of content).

Live Demo

The demo page for this element

Steps to reproduce

  1. Focus on the first textarea of the page (the one that is a single line initially).
  2. Type a few words (but not enough to wrap to a new line).
  3. Type Ctrl-Z to undo.
  4. Note that the content is undone in batches or entirely.
  5. Type several more words (enough to cause the textarea to grow to 2 or more lines).
  6. Type Ctrl-Z to undo repeatedly.
  7. Note that the characters are undone individually until there is only one line remaining (in which case it is undone in a batch again).

Browsers Affected

The behavior was observed only in Chrome.

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
@andybons
Copy link

andybons commented Aug 1, 2016

@notwaldorf @cdata

@andybons
Copy link

andybons commented Oct 4, 2016

Ping 🔔

@notwaldorf
Copy link
Contributor

I haven't looked at this -- if anyone has any ideas why this is happening, I'd love to hear them :)

@wyattallen
Copy link
Author

I'm still able to reproduce this bug.

If additional context is helpful, the issue was originally filed regarding our use of iron-autogrow-textarea in PolyGerrit. It's still reproducible there also.

@kaspnilsson
Copy link

Pinging again on this... The issue exists in the Polymer2 component as well.

@beckysiegel
Copy link
Contributor

@notwaldorf Played around with this a little bit, and narrowed down the issue. When I comment out the following line, command-z works as expected

https://github.com/PolymerElements/iron-autogrow-textarea/blob/master/iron-autogrow-textarea.html#L343

Still not sure why this is.
Repro-d with the iron-autogrow-textarea demo.

@beckysiegel
Copy link
Contributor

beckysiegel commented Jul 19, 2017

This doesn't appear to be a polymer bug, but somehow there's a difference when the event handler manipulates any innerHTML attribute:

See non-polymer repro http://jsbin.com/wogided/1/edit?html,css,output
Maybe a chrome bug?

I even tried to re-write the innerHTML with node creation/removal/replacement. removing/replacing nodes has the same behavior. Merely creating/appending does not.
http://jsbin.com/roqaxeh/edit?html,output

@beckysiegel
Copy link
Contributor

@notwaldorf
Copy link
Contributor

Omg @beckysiegel, this was AMAZING sherlocking! Thanks so much!!!

@beckysiegel
Copy link
Contributor

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants