bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Typeahead with typeahead-min-length="0" does not appear when clearing the text box.

Open kbrimington opened this issue 10 years ago • 2 comments

In a typeahead with minimum length configured to zero, if the user selects a value, then returns to the input and taps the browser-provided X to clear the box, the input is now focused and empty; however, the list box is hidden.

Typing and deleting a character at this point opens the box. Leaving and re-entering the input field also opens the box.

I observed the behavior in IE11, in a typeahead using the custom popup template from the demos. I have not verified other browsers or without templates.

<input type="text"
       ng-model="model"
       placeholder="Select an item"
       uib-typeahead="item.Name for item in items | filter:{Name:$viewValue}"
       typeahead-editable="false"
       typeahead-popup-template-url="customPopupTemplate.html"
       typeahead-min-length="0" />

kbrimington avatar Sep 01 '16 23:09 kbrimington

@kbrimington thnx for bringing this in. Could you please clarify what you mean by "taps the browser-provided X to clear the box"? A screenshot would be ideal. I presume that you talk about a clear button on the right added by some browsers but would like to confirm.

Depending on what we are talking about we would have to see if an appropriate DOM event is fired in that case or not. If not we are kind of blind to that user action...

pkozlowski-opensource avatar Sep 07 '16 17:09 pkozlowski-opensource

Thanks for your response. Your presumption was correct. I was referring to the clear button on the right added by many browsers.

For instance:

image

After tapping the browser-provided X, the input remains focused (note the cursor, below), but the typeahead is not visible.

image

Typing and deleting a character, or blurring and re-focusing the control behave normally, producing the typeahead popup.

image

kbrimington avatar Sep 08 '16 14:09 kbrimington