Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

md-chips: Focus state is triggered incorrectly #2607

Closed
chrisguerrero opened this issue Apr 28, 2015 · 8 comments
Closed

md-chips: Focus state is triggered incorrectly #2607

chrisguerrero opened this issue Apr 28, 2015 · 8 comments
Assignees
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Milestone

Comments

@chrisguerrero
Copy link
Contributor

I just updated to v0.9.0rc3 and noticed that the .md-focused class is applied to the wrong element.

The focus state is applied properly if I press ctrl or cmd while focussed on the element.

@marcysutton
Copy link
Contributor

Can you provide some more details? Which browser, and which demo? The .md-focused class is applied to md-chip when I click on it or use TAB + arrow keys. It looks correct.

@chrisguerrero
Copy link
Contributor Author

I'm using Chrome Version 42.0.2311.135 (64-bit)

It's the Custom Inputs section of the demo

@marcysutton
Copy link
Contributor

I'm still not seeing it. Some screenshots of the focused state and the Element inspector open would help narrow it down. Also, which element has .md-focused? Which element were you expecting?

@chrisguerrero
Copy link
Contributor Author

I'm not able to take a screenshot because pressing the command key while focused in the input sets the .md-focused class correctly. I'll outline the steps to reproduce below:

  1. Click first md-chips element in the "Custom Inputs" section (<input> is now focused, but .md-focused class is not added to <md-chips-wrap> element)
  2. Press Tab to move to next md-chips element in the "Custom Inputs" section (second <input> is now focused, but .md-focused class is added to the first <md-chips-wrap> element)
  3. Press Tab again to move to third md-chips element in the "Custom Inputs" section (third <input> is now focused, and no <md-chips-wrap> elements have .md-focused class)

I am seeing this behavior in Firefox as well.

@marcysutton
Copy link
Contributor

Ok, I see what you mean now–it's the <input> element that doesn't focus correctly. In fact, it's actually quite buggy. Thanks for the details, they helped a lot.

@topherfangio
Copy link
Contributor

@chrisguerrero A lot has changed with the chips recently, and I can't seem to reproduce this issue in 0.10.1 or master.

Can you verify if this has been fixed or if it's still an issue?

If it is still an issue, can you provide the instructions again? I don't see any existing chips in the Custom Inputs demo, so I think the demo itself may have changed.

Thanks!

@topherfangio topherfangio added the needs: feedback The issue creator or community need to respond to questions in this issue label Aug 15, 2015
@chrisguerrero
Copy link
Contributor Author

@topherfangio I do still see the issue in 0.10.1 and master, and the "Custon Inputs" demo is still there. It's one of the top level sections with a blue header, alongside "Basic Usage", "Contact Chips" and "Static Chips". The "md-focused" class is still being applied incorrectly, and the steps to reproduce are the same as my comment from 4/29.

@topherfangio
Copy link
Contributor

@chrisguerrero My apologies for making you comment again, I think I misread your instructions; I thought you were saying to click an existing chip, not the input, which is why I was confused.

I definitely see the issue now and will look into it :-)

@topherfangio topherfangio added type: bug and removed needs: feedback The issue creator or community need to respond to questions in this issue ui: browser labels Aug 17, 2015
topherfangio added a commit that referenced this issue Aug 27, 2015
 * Fix backspace key in Firefox to not change browser history/url

   In Firefox, the backspace key would also modify the browser's
   history/url.

 * Fix focus/blur on chips with custom input:

   Chips with a custom input did not properly update it's class
   list when the inner input was focused/blurred.

Fixes #3562. References #3960.
Fixes #2607.
@topherfangio topherfangio added the pr: merge ready This PR is ready for a caretaker to review label Aug 28, 2015
topherfangio added a commit that referenced this issue Aug 28, 2015
 * Fix backspace key in Firefox to not change browser history/url

   In Firefox, the backspace key would also modify the browser's
   history/url.

 * Fix focus/blur on chips with custom input:

   Chips with a custom input did not properly update it's class
   list when the inner input was focused/blurred.

Fixes #3562. Fixes #3960. Fixes #2607.
kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
 * Fix backspace key in Firefox to not change browser history/url

   In Firefox, the backspace key would also modify the browser's
   history/url.

 * Fix focus/blur on chips with custom input:

   Chips with a custom input did not properly update it's class
   list when the inner input was focused/blurred.

Fixes angular#3562. Fixes angular#3960. Fixes angular#2607. Closes angular#4359.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
Development

No branches or pull requests

4 participants