how to support same column size when screen size reducing in angular material table

Thanks for clarifying your problem on my request. for this behavior I would suggest you to use min-widht and max-widht to make you table cell looks similar on every screen, please use below CSS in your stackblitz th.mat-header-cell, td.mat-cell { text-align: center; border: 1px solid #ccc; padding: 0 !important; min-width: 100px; max-width: 100px; } Also … Read more

How to disable the selection of an item when the first letter of the option is pressed in the Select component?

The text focus navigation functionality is implemented in the onKeyDown of MenuList (I implemented it about 6 months ago). Stopping propagation of that event on the MenuItem (it would also work to stop propagation on the TextField) prevents the event from reaching MenuList. import * as React from “react”; import { render } from “react-dom”; … Read more

Material-ui adding Link component from react-router

For Material UI 1.0 with Typescript: see this post by @ogglas below. For Material-UI 1.0 with plain JS: <Tabs value={value} onChange={this.handleChange}> { this.props.tabs.map( ({label, path})=><Tab key={label} label={label} className={classes.tabLink} component={Link} to={path} /> ) } </Tabs> And classes.tabLink is defined as: tabLink : { display:”flex”, alignItems:”center”, justifyContent:”center” } How this works? All the mui 1.0 components inheriting … Read more

How do you change a style of a child when hovering over a parent using MUI styles?

Below is an example of the correct syntax for v4 (“& $addIcon” nested within &:hover). Further down are some v5 examples. import * as React from “react”; import { render } from “react-dom”; import { Grid, makeStyles } from “@material-ui/core”; import AddIcon from “@material-ui/icons/Add”; const useStyles = makeStyles(theme => ({ outerDiv: { backgroundColor: theme.palette.grey[200], padding: … Read more

Media queries in MUI components

By using the breakpoints attribute of the theme, you can utilize the same breakpoints used for the Grid and Hidden components directly in your component. API theme.breakpoints.up(key) => media query Arguments key (String | Number): A breakpoint key (xs, sm, etc.) or a screen width number in pixels. Returns media query: A media query string … Read more

Is it possible to override material-ui components default props?

The documentation for this is here: https://material-ui.com/customization/globals/#default-props Here is an example of how to do this in v4 (v5 example further down): import React from “react”; import ReactDOM from “react-dom”; import {createMuiTheme, MuiThemeProvider, Button} from “@material-ui/core”; const theme = createMuiTheme({ props: { MuiButton: { variant: “contained”, color: “secondary” } } }); function App() { return … Read more

Uncaught Invariant Violation: Too many re-renders. React limits the number of renders to prevent an infinite loop

I suspect that the problem lies in the fact that you are calling your state setter immediately inside the function component body, which forces React to re-invoke your function again, with the same props, which ends up calling the state setter again, which triggers React to call your function again…. and so on. const SingInContainer … Read more