Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable IE's native input "clear" control, since it doesn't work properly. #153

Closed
ZhouyangYe opened this issue Mar 1, 2017 · 10 comments
Closed

Comments

@ZhouyangYe
Copy link

Type in something to the field and clear it by clicking the 'x' sign on IE, then focus out by clicking somewhere else, the value retained.

@Tauka
Copy link

Tauka commented Mar 1, 2017

@ZhouyangYe As I know, the input is controlled by the state of the component, so there is no way to programmatically clear the input, other than using ref.getInstance().clear()

@ZhouyangYe
Copy link
Author

@Tauka Oh, that's why, and the 'x' on IE does not notify when it is clicked, so there is no way to check if it's clicked. I've tried, onchange event can capture the value change when focus out, is it possible that when user focus out, the component get the value from Input element and update the state?

@ericgio
Copy link
Owner

ericgio commented Mar 1, 2017

@ZhouyangYe: Can you please provide a repro case/code example? It sounds like you might be passing in a value that is setting the selection.

I can't repro your case in the example.

@ZhouyangYe
Copy link
Author

@ericgio Hi, do you mean to reproduce the issue? I created a Typescript element with empty options and empty onchange function. Type in some value and clear it using the 'X' on IE. Then focus out by clicking somewhere else. The value is retained when focus out.

@ericgio
Copy link
Owner

ericgio commented Mar 1, 2017

@ZhouyangYe: a code example or jsfiddle would be helpful.

@ZhouyangYe
Copy link
Author

@ericgio Can use the first example to test: http://ericgio.github.io/react-bootstrap-typeahead/

@ZhouyangYe
Copy link
Author

@ericgio It only happens on IE, with IE's default clear 'X'.

@ericgio
Copy link
Owner

ericgio commented Mar 1, 2017

Ah I see what you're saying now. That's expected behavior; all that's happening is the input value is being cleared, but the actual selections are not. See #34 for more context on why the component works this way. Use the clearButton prop to add an 'x' button to the component; that will call the clear() method internally.

I should disable the native IE control...

@ZhouyangYe
Copy link
Author

@ericgio o, I see, thanks!

@ericgio ericgio removed the not a bug label Mar 1, 2017
@ericgio ericgio changed the title IE's clear sign 'x' doesn't work correctly with Typeahead. Tested on IE11 Disable IE's native input "clear" control, since it doesn't work properly. Mar 1, 2017
ericgio added a commit that referenced this issue Mar 2, 2017
@ericgio
Copy link
Owner

ericgio commented Mar 2, 2017

Fixed in v1.2.0

@ericgio ericgio closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants