material-ui

several instances of `@material-ui/styles` initialized in this application

跟風遠走 提交于 2019-12-25 19:11:58
问题 I developed NPM and install @material-ui/core npm to use styles but when I am using that package in my application it gives me warning there are several instances of @material-ui/styles initialized in this application and style not apply in my project. Thanks. 来源: https://stackoverflow.com/questions/59351557/several-instances-of-material-ui-styles-initialized-in-this-application

Material-UI TextField Outline Label is overlapping with border when conditionally rendered

柔情痞子 提交于 2019-12-25 18:44:10
问题 https://codesandbox.io/s/material-demo-04y5b Steps to reproduce: Click "confirm" or "have a code?" to trigger a conditional render of a different form. Click the "Confirmation Code" TextField . Notice the border has rendered incorrectly and is causing the label to overlap with the border. For correct behavior initialize newUser with a value other than Null and see that the border has rendered correctly to accommodate the label. Any idea why this is happening? 回答1: A workaround that can solve

SelectableList does not display Selected item when selection change

泄露秘密 提交于 2019-12-25 09:15:15
问题 I have an issue with a SelectableList. When i display the list for the first time, the default defined item is selected in the list. But when i click on a different item of the list, the item does not appears as selected in the list, and the index is undefined . any suggestions ? This is the sample code of my SelectableList : import React from 'react'; import {List, ListItem, MakeSelectable} from 'material-ui/List'; import Avatar from 'material-ui/Avatar'; const SelectableList =

ReactJS — Overlay Button not Clickable when placed above a List

会有一股神秘感。 提交于 2019-12-25 09:00:08
问题 Please see the Code Example in Code Sandbox I have created I want the button action of the Floating Button to fire. But instead the Action assigned to the ListItem is triggered. Any Ideas solution will be highly appreciated. Thanks! 回答1: It's more a markup/styling issue than a js problem. The easiest thing you can do is set a z-index on the overflow container. const overlay = { position: 'absolute', bottom: 30, right: 10, zIndex: 100 } This makes your example working, but maybe there are

Re-rendering a Component Within another Component

江枫思渺然 提交于 2019-12-25 08:39:53
问题 So I have a component called TicketView that is used within another component of mine, which is just called Table . TicketView is initialized in the table just like this: <TableRow key={index}> ... <TableRowColumn style={{width: '80px'}}><TicketView id={row.TicketID} /></TableRowColumn> </TableRow> The TableRow data is propogated using Axios , and I have a 5 second refresh on the table to use a GET method to refresh the table data every 5 seconds. However, during the refresh, all the inputted

Problems with Material-UI components

久未见 提交于 2019-12-25 07:30:03
问题 I'm trying to use the http://www.material-ui.com/#/components/drawer (Docked Example) component from Material-UI with ReactJS. I get error an error on the "=" in the following line: handleToggle = () => this.setState({open: !this.state.open}); I get the same error on some other components as well. I'm using the latest version of Material-UI. Same with this one: http://www.material-ui.com/#/components/table (Complex Example) on the following code: handleToggle = (event, toggled) => { Any ideas

How to make an app bar using React & Material-UI like this?

…衆ロ難τιáo~ 提交于 2019-12-25 04:24:10
问题 How do I make an app bar that looks like this: I can create the top half of the app bar with the search box but I'm having trouble adding the bottom half. This is my code so far: <AppBar style={{backgroundColor: MuiTheme.palette.primary1Color, flexWrap: 'wrap'}} showMenuIconButton={false} title={explorerSearch} titleStyle={MuiTheme.title} iconClassNameRight='muidocs-icon-navigation-expand-more' > <Toolbar> <ToolbarGroup> {this._getContent()} </ToolbarGroup> </Toolbar> </AppBar> This is what

How do I access both the class and the calling object in an ES2015 class method?

爷,独闯天下 提交于 2019-12-25 03:52:44
问题 This is a beginner React.js / ES2015 question. I have some HTML that displays a list of book names: class BookList extends React.Component { render() { return ( <div> {this.state.books.map((book) => { return ( <TextField defaultValue={book.name} key={book.name} onEnterKeyDown={this.onBookNameChange} ... And when the user edits a name and presses enter I call a method in my class to check if the book exists and update my store: class BookList extends React.Component { onBookNameChange(event) {

How to left-align all list items using React Material-UI, fontAwesome icons and Tailwind.css

谁说胖子不能爱 提交于 2019-12-25 03:27:29
问题 I want to left-align the text of my list items. Currently, I have this: How can I left-align the text? import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

implementing footer in the advanced search tab drawer

江枫思渺然 提交于 2019-12-25 03:15:15
问题 I am trying to develop a sticky footer similar to w3schools. I used the same code in my material UI demo, but it is not working. I debugged and changed position from fixed to absolute , but it still doesn't work. Can you guys help me? Is it due to material ui or is it due to display block? When you click the advanced search tab, you can see the red color footer in the drawer. Providing my code snippet and sandbox below: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_fixed