feat: add onChange handlers to ChipSelect and Text components; clear imageQueue on background type and category changes

This commit is contained in:
alexsparkes
2025-10-31 16:42:15 +00:00
parent ef22e91b07
commit b303d02492
6 changed files with 71 additions and 14 deletions

View File

@@ -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 (