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

Bug - Can't select an option in autocomplete IE 11 #3351

Closed
allen-gopico opened this issue Mar 1, 2017 · 10 comments · Fixed by #3188
Closed

Bug - Can't select an option in autocomplete IE 11 #3351

allen-gopico opened this issue Mar 1, 2017 · 10 comments · Fixed by #3188
Assignees
Labels
P2 The issue is important to a large percentage of users, with a workaround

Comments

@allen-gopico
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When selecting an option in the auto complete , it should display the selected value in the text field

What is the current behavior?

When selecting an option in the auto complete, it does not display the selected value in the text field

What are the steps to reproduce?

  1. https://material.angular.io/components/component/autocomplete
  2. Go to example
  3. Type Ala
  4. Select Alabama

Which versions of Angular, Material, OS, browsers are affected?

IE 11

@crisbeto
Copy link
Member

crisbeto commented Mar 1, 2017

Are you talking about selecting by click or with the keyboard? The click issue should be resolved by #3188.

@kara kara added P2 The issue is important to a large percentage of users, with a workaround has pr and removed P2 The issue is important to a large percentage of users, with a workaround labels Mar 1, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 1, 2017
* Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the `event.relatedTarget` for blur events.
* Fixes potential issue if the user uses `mat-option`, instead of `md-option`.

Fixes angular#3351.
@allen-gopico
Copy link
Author

I'm referring to selecting by clicking , i've tried changing the md-option to mat-option but i've encounter an error (see image). I'm still looking for the cause.
image

@crisbeto
Copy link
Member

crisbeto commented Mar 2, 2017

The mat- prefix is opt-in, md- is the one that is on by default. As for the clicking issue, it'll be resolved by #3188.

@Only1MrAnderson
Copy link

@crisbeto When do you anticipate the pull request will be merged?

@djleonskennedy
Copy link

djleonskennedy commented Mar 15, 2017

Please clarify, when it will be merged, its very critical issue

crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 16, 2017
Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the event.relatedTarget for blur events.
Fixes potential issue if the user uses mat-option, instead of md-option.

Fixes angular#3351.
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 16, 2017
Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the event.relatedTarget for blur events.
Fixes potential issue if the user uses mat-option, instead of md-option.

Fixes angular#3351.
@benjamin-wilson
Copy link

Looks like it's pending review from @kara, this is a critical issue for us as well.

@Only1MrAnderson
Copy link

@djleonskennedy @benjamin-wilson . If you are looking for a short term solution here is what I am doing. Needed this for production and the merge is taking longer then I expected.
@angular/material/@angular/material.es5.js.

Change this one section
FROM:

     MdAutocompleteTrigger.prototype._handleBlur = function (newlyFocusedTag) {
         this._onTouched();
         // Only emit blur event if the new focus is *not* on an option.
         if (newlyFocusedTag !== 'MD-OPTION') {
             this._blurStream.next(null);
         }
     };

TO:

MdAutocompleteTrigger.prototype._handleBlur = function(newlyFocusedTag) {
        this._onTouched();
        if (newlyFocusedTag == null) {
            newlyFocusedTag = document.activeElement.className.indexOf('mat-option') >= 0 ? 'MD-OPTION' : '';
        }
        // Only emit blur event if the new focus is *not* on an option.
        if (newlyFocusedTag !== 'MD-OPTION') { //newlyFocusedTag !== 'MD-OPTION'
            this._blurStream.next(null);
        }
    };

crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 12, 2017
* Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the event.relatedTarget for blur events.
* Fixes potential issue if the user uses mat-option, instead of md-option.

Fixes angular#3351.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 12, 2017
* Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the event.relatedTarget for blur events.
* Fixes potential issue if the user uses mat-option, instead of md-option.

Fixes angular#3351.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 12, 2017
* Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the event.relatedTarget for blur events.
* Fixes potential issue if the user uses mat-option, instead of md-option.

Fixes angular#3351.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 12, 2017
* Fixes being unable to select autocomplete items by clicking in IE. This was due to IE not setting the event.relatedTarget for blur events.
* Fixes potential issue if the user uses mat-option, instead of md-option.

Fixes angular#3351.
@vinaykumaremmadi
Copy link

Thanks...by changing the code in @angular/material/@angular/material.es5.js.
It worked

@vinaykumaremmadi
Copy link

how to update material component..instead of changing it manually.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants