mirror of
https://github.com/mue/mue.git
synced 2026-07-18 14:34:12 +02:00
feat: add onChange handlers to ChipSelect and Text components; clear imageQueue on background type and category changes
This commit is contained in:
@@ -8,7 +8,7 @@ import FormControl from '@mui/material/FormControl';
|
||||
import Select from '@mui/material/Select';
|
||||
import Chip from '@mui/material/Chip';
|
||||
|
||||
function ChipSelect({ label, options }) {
|
||||
function ChipSelect({ label, options, onChange }) {
|
||||
let start = (localStorage.getItem('apiCategories') || '').split(',');
|
||||
if (start[0] === '') {
|
||||
start = [];
|
||||
@@ -22,6 +22,11 @@ function ChipSelect({ label, options }) {
|
||||
} = event;
|
||||
setoptionsSelected(typeof value === 'string' ? value.split(',') : value);
|
||||
localStorage.setItem('apiCategories', value);
|
||||
|
||||
// Call parent onChange if provided
|
||||
if (onChange) {
|
||||
onChange(value);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user