material-ui

How to display correct rows per page using Material UI table pagination

安稳与你 提交于 2020-12-13 17:57:31
问题 I'm trying to use Material UI table pagination to display 5 rows per page, but it shows all items on page and does not change pages. Cant find out where I'm making mistake. I have recreated my problem in sandbox, could you please check it : https://codesandbox.io/s/magical-davinci-t2nq7 state = { rowsPerPage: 5, page: 0 }; handleChangePage = (event, page) => { this.setState({ page }); }; handleChangeRowsPerPage = event => { this.setState({ rowsPerPage: event.target.value }); };

How to add a fancy scroll-bar on react material-table?

风格不统一 提交于 2020-12-13 03:27:48
问题 I'm using react material-table and want a decent scroll-bar instead of default Pagination. I have tried react-custom-scroll but it's not working as per my intention. The default scroll-bar of my App is activated. One more thing, how can I just apply this type of scroll on just the table body? import CustomScroll from 'react-custom-scroll'; . . . <div style={{height:"50vh"}}> <CustomScroll heightRelativeToParent="100%"> <MaterialTable . . options={{ search: true, paging: false,

Styling a card causes TextField to lose focus in Material UI + React

左心房为你撑大大i 提交于 2020-12-13 03:26:31
问题 I'm trying to style my card so that it's not so big but the problem is every time I do that, my TextField loses its' functionality and I have to keep on clicking on the TextField because it keeps on losing focus. I need to make my Card component smaller without losing the functionality of my TextField. https://codesandbox.io/s/mutable-monad-dsvf8?file=/src/index.js import React, { useState } from "react"; import ReactDOM from "react-dom"; import Grid from "@material-ui/core/Grid"; import

Styling a card causes TextField to lose focus in Material UI + React

£可爱£侵袭症+ 提交于 2020-12-13 03:25:34
问题 I'm trying to style my card so that it's not so big but the problem is every time I do that, my TextField loses its' functionality and I have to keep on clicking on the TextField because it keeps on losing focus. I need to make my Card component smaller without losing the functionality of my TextField. https://codesandbox.io/s/mutable-monad-dsvf8?file=/src/index.js import React, { useState } from "react"; import ReactDOM from "react-dom"; import Grid from "@material-ui/core/Grid"; import

How to add a fancy scroll-bar on react material-table?

一曲冷凌霜 提交于 2020-12-13 03:24:05
问题 I'm using react material-table and want a decent scroll-bar instead of default Pagination. I have tried react-custom-scroll but it's not working as per my intention. The default scroll-bar of my App is activated. One more thing, how can I just apply this type of scroll on just the table body? import CustomScroll from 'react-custom-scroll'; . . . <div style={{height:"50vh"}}> <CustomScroll heightRelativeToParent="100%"> <MaterialTable . . options={{ search: true, paging: false,

How to override Material UI .MuiContainer-maxWidthLg?

故事扮演 提交于 2020-12-10 08:50:05
问题 I'm trying to get rid of max-width that present in the theme. This is what I see in Chrome (and if I uncheck it, it does what I need): @media (min-width: 1280px) .MuiContainer-maxWidthLg { max-width: 1280px; } How can I do this? I tried something like this: const useStyles = makeStyles(theme => ({ root: { '& .MuiContainer-maxWidthLg' : { maxWidth: //No matter what I put here, it does not work }, but it does not seem to have any effect... How can I override this? Thanks, Alex 回答1: The maxWidth

How to override Material UI .MuiContainer-maxWidthLg?

谁说胖子不能爱 提交于 2020-12-10 08:48:46
问题 I'm trying to get rid of max-width that present in the theme. This is what I see in Chrome (and if I uncheck it, it does what I need): @media (min-width: 1280px) .MuiContainer-maxWidthLg { max-width: 1280px; } How can I do this? I tried something like this: const useStyles = makeStyles(theme => ({ root: { '& .MuiContainer-maxWidthLg' : { maxWidth: //No matter what I put here, it does not work }, but it does not seem to have any effect... How can I override this? Thanks, Alex 回答1: The maxWidth

Make a Material UI Component in React Sticky when scrolling (not AppBar)

自古美人都是妖i 提交于 2020-12-09 06:52:22
问题 So I have AppBar working fine. And I didn't even use sticky for that but I think I need some kind of sticky style to make my element in the page essentially stick at the top when the user scrolls. I essentially want this. https://www.w3schools.com/howto/howto_css_sticky_element.asp But within my React page I want my ProgressBar component to remain at the top. The component below this RenderTeamSelections which is a big table, it will push the ProgressBar out of view quickly. I want to kept

Align Card Buttons on bottom Material UI

时光总嘲笑我的痴心妄想 提交于 2020-12-08 10:57:42
问题 I am developing an app in ReactJS and i'm using the following: MaterialUI (for react) and React Flexbox. The problem i'm having is trying to position the card buttons on bottom (the problem that seems to have spammed the internet in different frameworks). I am using the card from here -> https://material-ui.com/demos/cards/ I've tried pretty much everything i could think of from align-items to align-self and different display types. I might be missing something here since i usually work with

Align Card Buttons on bottom Material UI

佐手、 提交于 2020-12-08 10:55:52
问题 I am developing an app in ReactJS and i'm using the following: MaterialUI (for react) and React Flexbox. The problem i'm having is trying to position the card buttons on bottom (the problem that seems to have spammed the internet in different frameworks). I am using the card from here -> https://material-ui.com/demos/cards/ I've tried pretty much everything i could think of from align-items to align-self and different display types. I might be missing something here since i usually work with