material-ui

Uncaught TypeError: Cannot read property 'injection' of undefined [closed]

China☆狼群 提交于 2020-05-28 13:31:11
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I am getting following error after upgrading react to 16.x Uncaught TypeError: Cannot read property 'injection' of undefined at injectTapEventPlugin (injectTapEventPlugin.js:23) at eval (index.js:53) at Object.<anonymous> (bundle.js:1363) at __webpack_require__ (bundle.js:556) at fn (bundle.js:87) at

Compile error using the Component Lab > Autocomplete feature for SVG Icons in Material UI

﹥>﹥吖頭↗ 提交于 2020-05-26 10:52:27
问题 I got the following error when I ran my project on the browser: Failed to compile: ./node_modules/@material-ui/lab/esm/internal/svg-icons/Close.js Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'. I'm trying to implement the Autocomplete component (from the example in the "Multiple values" section). Here is the code I'm using: import React from 'react'; import Chip from '@material-ui/core/Chip'; import Autocomplete from '@material-ui/lab/Autocomplete';

Compile error using the Component Lab > Autocomplete feature for SVG Icons in Material UI

无人久伴 提交于 2020-05-26 10:51:05
问题 I got the following error when I ran my project on the browser: Failed to compile: ./node_modules/@material-ui/lab/esm/internal/svg-icons/Close.js Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'. I'm trying to implement the Autocomplete component (from the example in the "Multiple values" section). Here is the code I'm using: import React from 'react'; import Chip from '@material-ui/core/Chip'; import Autocomplete from '@material-ui/lab/Autocomplete';

ReactJS: Material ui breakpoints

泪湿孤枕 提交于 2020-05-25 01:07:21
问题 What is the difference between breakpoints.up , breakpoints.down , breakpoints.between and breakpoints.value ? And what is meant by this code, how breakpoints value is working here? Is theme.spacing.unit*2*2 = theme.spacing.unit*4 or it has some other meaning? [theme.breakpoints.up(600 + theme.spacing.unit * 2 * 2)]: { width: 600, marginLeft: 'auto', marginRight: 'auto', }, 回答1: Material uses the following set of breakpoints. You can customize the values of this breakpoint in the theme.

switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons

非 Y 不嫁゛ 提交于 2020-05-23 21:10:33
问题 I was using Material design 1.1.0 . For tabs with viewpager2 I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I've developed my custom material designed TextInputLayout. I changed theme from 'Theme.AppCompat.Light.NoActionBar' to Theme.MaterialComponents.Light.NoActionBar and crash fixed. After fixing crash and upgrading theme it is showing me white floating label , buttons , indiators etc anyone please

switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons

…衆ロ難τιáo~ 提交于 2020-05-23 21:09:08
问题 I was using Material design 1.1.0 . For tabs with viewpager2 I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I've developed my custom material designed TextInputLayout. I changed theme from 'Theme.AppCompat.Light.NoActionBar' to Theme.MaterialComponents.Light.NoActionBar and crash fixed. After fixing crash and upgrading theme it is showing me white floating label , buttons , indiators etc anyone please

MultiSelect box popover keeps jumping when scroll or select items

依然范特西╮ 提交于 2020-05-23 12:59:12
问题 MultiSelect box popover keeps jumping when scroll or select items Codepen https://codesandbox.io/s/material-demo-e5j8h import React from "react"; import { makeStyles } from "@material-ui/core/styles"; import Input from "@material-ui/core/Input"; import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; import FormControl from "@material-ui/core/FormControl"; import ListItemText from "@material-ui/core/ListItemText"; import Select from "@material

MultiSelect box popover keeps jumping when scroll or select items

孤人 提交于 2020-05-23 12:58:01
问题 MultiSelect box popover keeps jumping when scroll or select items Codepen https://codesandbox.io/s/material-demo-e5j8h import React from "react"; import { makeStyles } from "@material-ui/core/styles"; import Input from "@material-ui/core/Input"; import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; import FormControl from "@material-ui/core/FormControl"; import ListItemText from "@material-ui/core/ListItemText"; import Select from "@material

Material UI – Global checkbox focus styling (not locally)

社会主义新天地 提交于 2020-05-23 11:05:21
问题 Trying to alter styling of checkbox when it is focused at a global level using Material-UI (react). At the moment only default and hover styling is working: MuiCheckbox: { colorSecondary: { color: 'green', '&:hover': { color: 'blue !important', border: '1px solid rgba(0,0,0,0.54)', outline: '2px auto rgba(19,124,189,.6)' } }, } What i'm trying to do, but is NOT working: MuiCheckbox: { colorSecondary: { '&$focused': { color: 'blue', border: '1px solid rgba(0,0,0,0.54)', outline: '2px auto rgba

How to extend Material-UI Theme with Typescript?

萝らか妹 提交于 2020-05-23 07:35:45
问题 Typescript is always complaining about certain properties missing in the palette. My app works just fine if I add //@ts-ignore , but I obviously want to avoid that. I'm new to Typescript and here is what I've tried. import createMuiTheme, { ThemeOptions, Theme } from '@material-ui/core/styles/createMuiTheme'; import { PaletteOptions } from '@material-ui/core/styles/createPalette'; interface IPaletteOptions extends PaletteOptions { chip: { color: string, expandIcon: { background: string, color