View Full Version : placeHolder broken when value contains double quote

26 Jan 2012, 2:18 PM
Sencha Touch version tested:


only default ext-all.css
Platform tested against:

iOS 5

Any placeHolder attribute that contains a double quote will be truncated beyond the first double quote.
Test Case:

See this URL: http://bcoffield.dyndns.org/sencha/bugs/placeholder/index.html
Steps to reproduce the problem:

Observe the problem and see that the expected results diverge from the actual results (see below for expected and actual). Code to reproduce the bug is at http://bcoffield.dyndns.org/sencha/bugs/placeholder/main.js
The result that was expected:

placeHolder text should be: Search for "a value"
The result that occurs instead:

placeHolder text was: Search for
Screenshot or Video:

Debugging already done:

The HTML5 placeholder attribute is cut off at the first double quote, leaving the attribute value incomplete.
Possible fix:

Modify renderTpl in Ext.form.Field to HTML encode placeHolder. So, modify this line in Field.js to include a :htmlEncode for placeHolder:
'<tpl if="placeHolder">placeholder="{placeHolder:htmlEncode}" </tpl>',