Page MenuHomePhabricator

$.byteLimit gets confused when pasting text at the beginning of the input field that has a common prefix with the current text
Open, LowPublic

Description

If you paste text at the beginning of the input field that has a common prefix with the current text (or, simply, is identical), $.byteLimit gets confused about which part was there already and which is new. It doesn't seem possible to work around this without a larger rewrite, as we do not track this information. :/

Simplified test case:

  • Have input with with bytelimit=12: $('#mw-content-text').replaceWith( $('<input>').byteLimit(12) )
  • Have text in it "ążśó" (8 bytes, 4 characters)
  • Paste "ążśó" at the beginning
  • Expected result: "ążążśó", actual result: "ążśóąż"

Version: 1.23.0
Severity: normal

Details

Reference
bz62454

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:55 AM
bzimport set Reference to bz62454.
bzimport added a subscriber: Unknown Object (MLST).
He7d3r set Security to None.
Jdlrobson subscribed.

Not sure how to tag this one. Is it impacting gadgets or a specific part of our interface?

It impacts edit summaries, for example.