-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Clear input button for text inputs #1834
Comments
We've discussed this and will add an option to add a cear button to any of the single line text inputs. |
Awesome, I'm really glad to hear this. |
Has there been any progress on this yet? |
Since this a new feature, it's not as high a priority as other, core things. We'll see what we can do. |
Added to the feature request wiki page: |
I guess it's too much to hope there's a patch or something to try this until it finds it way into mainline? |
Any update on this feature? |
We'll look at adding this to 1.3. Re-opening. |
I have a quick and simple workaround until this feature is in the stable version. In your HTML markup, use type="search" in your input tag. After your page has been initialized (best to catch it in the "pageshow" event), change the property type from "search" to "email" or "password" or whatever you need. Hide the search icon if you need to by overriding its CSS. It works like a charm. |
We're adding this soon for 1.3. Looking for input on the option name - |
Sounds good to me. |
Perfect! It will be nice to have a clear-button option built in so as to -Keith Alexander W. On Wed, Nov 7, 2012 at 2:52 PM, Ryan Ilg notifications@github.com wrote:
|
By any chance have you guys started coding this yet? We have an implementation that could be submitted for review. |
…ure request jquery-archive#1834 - clear input button for text inputs
…ut type text. Feature request jquery-archive#1834 - clear input button for text inputs
…uest jquery-archive#1834 - clear input button for text inputs
See my comment at @collinforrester his PR #5281 What is your opinion regarding those two bullets?
|
@uGoMobi I think we should use clearButtonText across the board for consistency so deprecate clearSearchButtonText is good (note this in the upgrade guide) Re: the the native conflicts, it looks like the native stuff actually prevents the clear button from appearing at all - is that right? http://jquerymobile.com/branches/text-input-clear-btn/docs/demos/textinput/index.html If that's the case, we may be able to remove things like the spinner arrows via CSS but that would be a limitation we'd document. If you want clear buttons, the spinners would go away. Worth looking into more. |
On Chrome: The number input gets the clear button on top of the spinner (only if you actually type a number). The date input did't get the clear button at all. I will check all major browsers on Linux/Mac OS/Windows. |
If the 'new' number inputs on Chrome and any browser are supported an extra margin/padding right should be added I think.
|
Re: If the input type is not "text" it doesn't mean it is "number" ("date", "tel", "password", "file", "search"). About the date input: On Safari desktop a spinner is added. Chrome desktop, Opera desktop, and Opera Mobile show a "select indicator" for the datepicker. On Chrome for Android there is no indicator for the datepicker, but the clear button doesn't work. |
…e. Feature jquery-archive#1834: clear input button for text inputs
…inputs. Feature jquery-archive#1834: clear input button for text inputs
This feature landed with commit d538941 and will be available in 1.3. We have to see if add some input types (date, number, color) to the blacklist because there might be conflicts with native browser controls. Note that the new option clearBtn (data-clear-btn) can't be set to false for search inputs. Also, textarea can't get a clear button. |
just a final related question: will we be able to use the mechanism used to display this button to also display our own custom buttons? I.e. something like a file-input but the browse button get some selection data via ajax and opens a dialog ... |
The behaviour and button icon of this feature are hardcoded, but you could copy and edit the code to add a custom button. Prevent the framework from enhancing the input and bind a call to your function to the "pagecreate" event. However, when it comes to the file input you are very limited in what you can customize, because of security reasons. File inputs are meant to submit a local file, not a file from your server, so you can't access that via Ajax. |
@uGoMobi |
Was this added? I have the latest RC and html such as this: and I am not getting the clear icon |
Yes it has been added. I can't see your html because you didn't wrap it in triple backticks, but I suggest you look in the docs (http://jquerymobile.com/demos/1.3.0-rc.1/docs/forms/textinputs/) how to use this option. |
@uGoMobi |
Do you have any special language / keyboard settings for your system or browser. Do you use multibyte characters? |
No. No special settings all default and both desktop browser experience the same thing. No clear button. |
@cas8180 - Can you post a screenshot here? You can just drag and drop the image in a comment. Thanks! Edit: I mean... screenshot of text input that should get a clear button but doesn't have it while there is text in it. |
New feature is great and monitors text change and focus to hide itself, but doesn't monitor Form Reset. When resetting a form by button or code the clear buttons remain on the inputs. |
Is there anyway to disable the Clear Button from Search? |
Programmatically I don't know of a way, but I don't see why you couldn't just remove the DOM elements before page show and take the padding-right for those elements back down to 5px or so. .ui-input-search {
padding-right: 5px;
} $('.ui-input-clear').remove(); // in the appropriate jQM event handler |
Thanks @collinforrester, On Thu, Apr 3, 2014 at 6:08 AM, collinforrester notifications@gh.neting.ccwrote:
|
Would it be possible to add a feature request for an optional clear button on text fields as per the search field clear button?
The text was updated successfully, but these errors were encountered: