Last modified: 2014-02-02 19:56:46 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 T49057, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47057 - jquery.placeholder: Polyfill implementation should not affect .val() and submission
jquery.placeholder: Polyfill implementation should not affect .val() and subm...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.19
All All
: Normal normal (vote)
: 1.23.0 release
Assigned To: Nobody - You can work on this!
:
Depends on: 57179
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-09 20:51 UTC by Amir E. Aharoni
Modified: 2014-02-02 19:56 UTC (History)
8 users (show)

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


Attachments

Description Amir E. Aharoni 2013-04-09 20:51:08 UTC
jquery.placeholder is applied to all input elements with a placeholder class.

In IE, this causes .val() to return the placeholder string when it's supposed to be empty. It causes bug 47039 in Translate and may cause other issues.

As an experiment, I tried replacing the core jquery.placeholder.js with the
plugin of the same name from here:
https://github.com/mathiasbynens/jquery-placeholder 

Everything just worked, including the placeholder in the search box.

Of course, it needs more testing, and the whole thing may also have some other solution.
Comment 1 Krinkle 2013-04-09 20:53:50 UTC
Rephrasing summary, there is nothing "built-in" about jquery.placeholder.

(In reply to comment #0)
> jquery.placeholder is applied to all input elements with a placeholder class.

Attribute, not class. <input placeholder="xx"> not <input class="placeholder">
Comment 2 Siebrand Mazeland 2013-04-09 22:51:44 UTC
Changed the relationship with bug 47039 from depends on to see, as we're implementing a work-around.
Comment 3 Michael M. 2013-04-10 07:41:45 UTC
Is this a duplicate of bug 40430?
Comment 4 Amir E. Aharoni 2013-04-10 07:57:50 UTC
(In reply to comment #3)
> Is this a duplicate of bug 40430?

I don't think so.
Comment 5 Bartosz Dziewoński 2013-09-15 17:27:08 UTC
(In reply to comment #0)
> As an experiment, I tried replacing the core jquery.placeholder.js with the
> plugin of the same name from here:
> https://github.com/mathiasbynens/jquery-placeholder 

This could be a good idea (less of our own code = better), but that
scripts seems to be missing two bits of functionality:

* Calling it as $(…).placeholder('Placeholder text') to set placeholder
  (its .placeholder function doesn't accept any arguments).

* Support for inserting values into inputs with placeholders defined –
  dragging text or rightclick-pasting it could result in new value
  being appended to the placeholder or inserted in the middle of it.

If its maintainer wants to implement it, we could probably swap our
version for it like you suggested.
Comment 6 Gerrit Notification Bot 2013-11-18 10:26:48 UTC
Change 95748 had a related patch set (by Bartosz Dziewoński) published:
Relicense jquery.placeholder.js to MIT

https://gerrit.wikimedia.org/r/95748
Comment 7 Gerrit Notification Bot 2013-11-18 10:30:42 UTC
Change 95748 merged by jenkins-bot:
Relicense jquery.placeholder.js to MIT

https://gerrit.wikimedia.org/r/95748
Comment 8 Bartosz Dziewoński 2013-11-18 10:39:06 UTC
So I've had our jquery.placeholder relicensed to MIT (same as the library linked by Amir in comment 0) and filed a parent bug about merging them (bug 57179). Doing that (or just porting the relevant part) will fix this bug.
Comment 9 Bartosz Dziewoński 2013-11-30 14:36:21 UTC
Now with I1ecca3d8 merged this should work. I'd appreciate if you could verify, Amir :)
Comment 10 Andre Klapper 2014-01-23 15:31:50 UTC
Amir: Could you please answer comment 9?
Comment 11 Bartosz Dziewoński 2014-02-02 19:56:46 UTC
Meh, I'll just mark it as fixed.

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


Navigation
Links