Last modified: 2014-03-11 10:57:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64454, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62454 - $.byteLimit gets confused when pasting text at the beginning of the input field that has a common prefix with the current text
$.byteLimit gets confused when pasting text at the beginning of the input fie...
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.23.0
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-09 15:40 UTC by Bartosz Dziewoński
Modified: 2014-03-11 10:57 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bartosz Dziewoński 2014-03-09 15:40:12 UTC
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: "ążśóąż"

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links