Разбираемся в CSS
Anonymous
Установить высоту TextField
Сообщение
Anonymous » 31 май 2024, 21:42
index.js
Код: Выделить всё
import React from 'react'
import TextField from '@material-ui/core/TextField'
import style from './style'
import withStyles from 'hoc/withStyles'
import { connect } from 'react-redux'
class SearchField extends React.Component {
constructor (props) {
super(props)
this.onChange = this.onChange.bind(this)
}
onChange (event) {
const { dispatcher } = this.props
this.props.dispatch(dispatcher(event.target.value))
event.preventDefault()
}
render () {
const { classes, placeholder } = this.props
return (
)
}
}
export default withStyles(style)(connect()(SearchField))
style.js
Код: Выделить всё
export default function () {
return {
container: {
display: 'flex',
flexWrap: 'wrap'
},
textField: {
width: 'auto'
},
resize: {
fontSize: 11
}
}
}
https://material-ui.com/api/text-field/
Как я могу изменить Высота TextField? Я не могу найти его в документации. При попытке изменить напрямую в CSS работает некорректно (выглядит это так - выбрана высота на экране 26px).
Что делать?
Подробнее здесь:
https://stackoverflow.com/questions/538 ... aterial-ui
1717180945
Anonymous
[b]index.js[/b] [code]import React from 'react' import TextField from '@material-ui/core/TextField' import style from './style' import withStyles from 'hoc/withStyles' import { connect } from 'react-redux' class SearchField extends React.Component { constructor (props) { super(props) this.onChange = this.onChange.bind(this) } onChange (event) { const { dispatcher } = this.props this.props.dispatch(dispatcher(event.target.value)) event.preventDefault() } render () { const { classes, placeholder } = this.props return ( ) } } export default withStyles(style)(connect()(SearchField)) [/code] [b]style.js[/b] [code]export default function () { return { container: { display: 'flex', flexWrap: 'wrap' }, textField: { width: 'auto' }, resize: { fontSize: 11 } } } [/code] https://material-ui.com/api/text-field/ Как я могу изменить Высота TextField? Я не могу найти его в документации. При попытке изменить напрямую в CSS работает некорректно (выглядит это так - выбрана высота на экране 26px). Что делать? Подробнее здесь: [url]https://stackoverflow.com/questions/53854030/set-textfield-height-material-ui[/url]