Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Width doesn't set through style property #6

Closed
ashl1 opened this issue Sep 15, 2016 · 1 comment
Closed

Width doesn't set through style property #6

ashl1 opened this issue Sep 15, 2016 · 1 comment
Assignees
Labels

Comments

@ashl1
Copy link

ashl1 commented Sep 15, 2016

Seems, width set to undefined in https://github.com/TeamWertarbyte/material-ui-chip-input/blob/master/src/ChipInput.js#L312 if fullWidth isn't set.
I recommend to initialize structure with if statement instead of explicit using undefined with ternary operator. This prevent rewriting attributes defined in style property.
Another approach is to use style attributes as backup values, but this do impossible to use another extend. The best safe operation is not to initialize the object attribute with any (include undefined) value, as I write above.

@leMaik
Copy link
Member

leMaik commented Sep 15, 2016

😮 Whoops... I didn't know that Object.assign({foo: 42}, {foo: undefined}) results in {foo: undefined}. I'll change this to an if structure, as you suggested, which will be more readable, too.

Edit: Same for marginTop and cursor.

@leMaik leMaik added the bug label Sep 15, 2016
@leMaik leMaik self-assigned this Sep 15, 2016
@leMaik leMaik closed this as completed in 39a8b69 Sep 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants