Closed mbrookes closed 8 years ago
@mbrookes I'll create a separate issue for it.
@mbrookes this is the pretty severe bug I mentioned: https://github.com/callemall/material-ui/issues/4149
@mbrookes Something I just realised:
handleMouseEnter = (event) => {
this.handleFocus();
this.props.onMouseEnter(event);
};
This fires the handleFocus()
function, which then fires the props.onFocus
handler. The problem here is that we are telling the user that the element has been focussed, when in fact it has just been hovered.
We should try to keep the two event handlers separate -- and use another function if they need to share behaviour.
Just making a note here based on discussion in gitter:
Aside from whether or not hover should trigger shadow by default, the only suggestion I have is to change the font size and weight to 14px
and normal
/400
.
Fixed all the things. :)
Just playing with this again, and something still doesn't feel right with the "no onTouchTap
event" chips.
Should deletable chips have hover state, even though they have no click handler, (i.e. have everything except shadow on click?) I have no clue! 😄
Current behaviour is that they don't change appearance (or pointer) on hover, but they can by focused with the mouse or keyboard, and change color to the focused color.
Other implementations: http://materializecss.com/chips.html No states at all.
https://material.angularjs.org/latest/demo/chips No hover state. Changes color on focus. No shadow when clicked. No pointer change.
http://react-toolbox.com/#/components/chip Only the delete icon has hover state and pointer.
So I think Chip behaves better than all of those...
Edit: Missing (
@mbrookes wanna squash the 3 chip commits into 1?
Done.
@callemall/material-ui can we get another set of eyes to review this (properly)? Then we can merge IMO.
@mbrookes I have only see minor issues. That's a great PR 👍.
@oliviertassinari Thanks!
Let me know if that looks okay, and I'll squash.
Is this going to work with Autocomplete, like rendering Chips in text field at least?
@zachguo This is just the chip itself, but an input component would be a natural place to use it.
@mbrookes @zachguo is there any plan to build an example using autocomplete with chips? I think it is really important for chip component, I will try to build multiple selectable autocomplete with chips maybe we can talk on that?
@keremciu yes, just not immediately
@mbrookes squash the fix all the things
@keremciu You could open an issue for that with relevant screenshots, links to other implementations etc.
@nathanmarks Done.
Any idea why Chip doesn't show in the default coverage report? (Also do we need a couple more tests?)
@nathanmarks Yeah, I found that - that's why I asked about adding tests (for those last couple of functions).
The question was why Chip doesn't show in the default coverage report. https://coveralls.io/builds/6118507 Just seems odd not to include new modules, tested or otherwise.
@mbrookes must be a little bug -- will report it
@mbrookes That looks us some time. That worth it 🎉 .
This is great- well needed! Thanks @tim
@mbrookes @nathanmarks, in reference to @keremciu's comment on May 10th:
is there any plan to build an example using autocomplete with chips? I think it is really important for chip component, I will try to build multiple selectable autocomplete with chips maybe we can talk on that?
Is there any update on when examples with Autocomplete and Chips will be made? This use case is of particular interest to myself and I presume many others as well.
@muxica I don't believe anyone is working on it.
+1 on the Autocomplete chips integration.
For anyone still looking that hasn't spotted it in related projects: https://github.com/TeamWertarbyte/material-ui-chip-input
tests/ docs demo, and is linted.New
Chip
component.Features:
Still to do:
Agree the API - currently supports both props and composability forlabel
andAvatar
. As a new component we might want to only support composability.Decide on required event callbacks. I took a kitchen sink approach, but we might want to narrow it down (or add others, such as drag events).PropTypeDescription
is refusing to work, and I'm not sure why, so Ive removed it from the docsPage.js
for now.Refactoring based on @callemall/material-ui review :sweat_smile:Tests.(Thanks @nathanmarks!)Delete button not working in Firefox. (zIndex?)(Thanks @newoga!)Closes #1119.