-
30 Oct 2012 7:53 PM #1
Answered: Textfield clear button (x) / HTML5 search field clear button not working
Answered: Textfield clear button (x) / HTML5 search field clear button not working
The clear button (x) in a textfield is not working in one of my apps. Not sure what I have broken, but it now only clears the text after clicking on the "x" 4-5 times. Has anyone seen this before and found the cause of the problem / a solution?
-
Best Answer Posted by IAmCoder
I managed to get it working with this hack:
So I manually set the text to an empty string and then have a line of code that throws an error.Code:[...].getComponent('FieldName').setValue(''); target.setValue(''); // This line throws an error, but the text field is cleared
-
1 Nov 2012 9:51 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
I have not had any issues for it myself. Is there an element on top of it capturing the tap or did you override the method that handles it?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Nov 2012 9:02 PM #3
No. I have noticed that it is clearing it - I just have to select another text field for it to refresh. So when you click on the clear button, the cursor moves all the way to the left, but the text is still there. It only clears the text once the control loses focus.
I am trying to do this programmatically; getComponent('OtherSearchField').element.dom.focus(), but that does not help.
-
5 Nov 2012 2:19 AM #4
I managed to get it working with this hack:
So I manually set the text to an empty string and then have a line of code that throws an error.Code:[...].getComponent('FieldName').setValue(''); target.setValue(''); // This line throws an error, but the text field is cleared


Reply With Quote