This commit is contained in:
seb
2026-10-10 22:29:06 +02:00
parent 0dbc7e2f65
commit d5aca2b183

View File

@@ -22,6 +22,18 @@ import {
} from '../../colors'; } from '../../colors';
class ArtikelMarkenSearchField extends PureComponent { class ArtikelMarkenSearchField extends PureComponent {
constructor(props) {
super(props);
this.state = { input: '' };
}
onInputChange(input) {
this.setState({ input });
}
clearInput() {
this.setState({ input: '' });
}
render() { render() {
const { inputRef } = this.props; const { inputRef } = this.props;
@@ -40,8 +52,8 @@ class ArtikelMarkenSearchField extends PureComponent {
sx={{ maxWidth: 520, flexGrow: 1 }} sx={{ maxWidth: 520, flexGrow: 1 }}
autoFocus autoFocus
autoComplete="off" autoComplete="off"
value={''} value={this.state.input}
onChange={() => { }} onChange={(e) => this.onInputChange(e.target.value)}
slotProps={{ slotProps={{
htmlInput: { htmlInput: {
autoCapitalize: 'off', autoCapitalize: 'off',
@@ -58,7 +70,7 @@ class ArtikelMarkenSearchField extends PureComponent {
<InputAdornment position="end"> <InputAdornment position="end">
<IconButton <IconButton
size="small" size="small"
onClick={() => { }} onClick={() => this.clearInput()}
onMouseDown={(e) => e.preventDefault()} onMouseDown={(e) => e.preventDefault()}
aria-label="Suche löschen" aria-label="Suche löschen"
> >