Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Can't select item from the menu in IE11 #257

Open
milencheto opened this issue Jul 18, 2017 · 14 comments
Open

Can't select item from the menu in IE11 #257

milencheto opened this issue Jul 18, 2017 · 14 comments

Comments

@milencheto
Copy link

Hi, guys... I have a problem on IE11. When I open the menu, it shows my list, but I can't click on it to choosing some option. It looks like IE11 recognize the items just like a text but not links.. Can you help me?

@CMTegner
Copy link
Collaborator

Hi Milena! Can you provide a reduced test case so we can help debug this problem? Perhaps it's reproducible in one of the examples?

@milencheto
Copy link
Author

milencheto commented Jul 24, 2017

facebook/react#6614
It looks like other people have the same and more problems with this component.

@CMTegner
Copy link
Collaborator

I'm not sure how that React core issue relates to your original description. Is the autofill some how preventing you from selecting items from the menu?

@gregdillon
Copy link

gregdillon commented Jul 27, 2017

I just noticed this issue the latest version of Safari as well.

UPDATE: So it looks like Safari is requiring a double-click on the item to select, versus a single-click in chrome. May not be related to the original issue.

@CMTegner
Copy link
Collaborator

@gregdillon seems like the examples work fine (i.e. only require a single click to select) in Safari. Can you provide a reduced test case that demonstrates the problem?

@gregdillon
Copy link

@CMTegner I'll keep looking. Not sure what is going on and it may be my implementation. I'll report back if/when I figure out. Thanks.

@rek
Copy link

rek commented Aug 7, 2017

Any news? I also have this issue with IE11 and EDGE.

@CMTegner
Copy link
Collaborator

CMTegner commented Aug 7, 2017

@rek can you create a reduced test case which reproduces the error?

@rek
Copy link

rek commented Aug 8, 2017

Working on it :)

@rek
Copy link

rek commented Aug 9, 2017

Is there a JSFiddle or anything I can start from to try and reproduce this there?

@CMTegner
Copy link
Collaborator

@rek try this JSBin: http://jsbin.com/mipesawapi/edit?js,output

@rek
Copy link

rek commented Jun 27, 2018

We found a fix for this. Our problem was in our implementation. It was because we had a dynamic Id in the inputProps.id directly, once we changed this it started working.

Here is what we changed it to:

import AutocompleteBase from 'autocomplete'

export class AutoComplete extends React.Component {
	autoCompleteId = _.uniqueId(this.props.id || 'autocomplete-')
	...
	render() {
		...

		return (
			<AutocompleteBase
				inputProps={{
					name: this.props.title,
					id: this.autoCompleteId,
				}}
				...
			/>
		)
	}
}

@dennisat
Copy link

@rek this didn't work for me.
Also without id didn't work either.

@dennisat
Copy link

I found the bug in my code.
The key in the shouldItemRender should be unique id per item and not new value.

In shouldItemRender as key of the JSX Element, I was assigned a different value always.

So I had something like this:
shouldItemRender={(item, value)=><div key={this.cheapGuid++}>{value}</div>}

Yeah, I know, it is anti-pattern since it renders all the items always but I had no unique id there.

For some reason, in MS Browsers (IE11 & Edge) the items are not clickable till you assign a unique key for each item as key in shouldItemRender.

Ensure that the key is unique, otherwise, the items might flicker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants