ReferenceArrayInput ignores withStyles and doesn't have fixed size of width by default
See original GitHub issueWhat you were expecting:
either be able to set width with withStyles
or it shouldn’t be width: 100%/ display:flex all the time
demo here shows chips that wrap: https://github.com/TeamWertarbyte/material-ui-chip-input
What happened instead:
chips are floating left to each other ever-expanding the screen size
Steps to reproduce: Here is a codesandbox that I tried to use withStyles without any result: https://codesandbox.io/s/1oj3j8yj0j - please click on a post and try to add as many tags as possible to see the effect
Related code:
import { withStyles } from '@material-ui/core/styles';
const styles = {
maxInputSize: {
maxWidth: 600,
width: 600,
},
};
const MaxWidthReferenceArrayInput = withStyles(styles)(
({ classes, ...props }) =>
<ReferenceArrayInput label="Tasks" source="tasks" reference="tasks"
allowEmpty={true} className={classes.maxInputSize} {...props}>
<AutocompleteArrayInput optionText="alias" className={classes.maxInputSize}
options={{ allowDuplicates:false}}/>
</ReferenceArrayInput>
);
[...]
<MaxWidthReferenceArrayInput/>
[...]
Other information: days ago was posted here as well: https://stackoverflow.com/questions/52915392/how-to-set-maxwidth-in-referencearrayinput
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Device width and height in material-ui - css - Stack Overflow
I am using makeStyles() hook, whereas you are using withStyles() , doesn't have any difference between these two.
Read more >CHANGELOG.md · 邹昊坤/marmelab-react-admin - Gitee.com
Fix <TestContext> doesn't contain notifications node (5659) (fzaninotto); Fix <Filter> fails to show compound filters with no default value (5657) ( ...
Read more >warning: [antd: form.item] `name` is only used for validate ... - You.com
In 4.0, we adjusted the icon usage API to support tree shaking, reducing the default package size of Antant by about 150 KB...
Read more >ra-core: Versions - Openbase
Fix <Loading> component doesn't translate messages (#8269) (WiXSL); [Doc] Fix typos ... you will need to set a default value of empty string...
Read more >UPGRADE.md · 27e446b9cf53340b3fb83f069094db4b3b0a2582 ...
Upgrade to 3.0. We took advantage of the major release to fix all the problems in react-admin that required a breaking change. As...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey there @zifnab87! I had the same exact problem and stumbled on this issue. I managed a way through it using the
classes
prop and nested selectors:Hope it also works for you!
@eaverdeja this worked great! more specifically I did: