Reset multi-color when single color is selected
This commit is contained in:
@@ -63,6 +63,9 @@ export const FilamentEdit: React.FC<IResourceComponentsProps> = () => {
|
|||||||
const originalOnFinish = formProps.onFinish;
|
const originalOnFinish = formProps.onFinish;
|
||||||
formProps.onFinish = (allValues: IFilamentParsedExtras) => {
|
formProps.onFinish = (allValues: IFilamentParsedExtras) => {
|
||||||
if (allValues !== undefined && allValues !== null) {
|
if (allValues !== undefined && allValues !== null) {
|
||||||
|
if (colorType == "single") {
|
||||||
|
allValues.multi_color_hexes = '';
|
||||||
|
}
|
||||||
// Lot of stupidity here to make types work
|
// Lot of stupidity here to make types work
|
||||||
const stringifiedAllValues = StringifiedExtras<IFilamentParsedExtras>(allValues);
|
const stringifiedAllValues = StringifiedExtras<IFilamentParsedExtras>(allValues);
|
||||||
originalOnFinish?.({
|
originalOnFinish?.({
|
||||||
|
|||||||
Reference in New Issue
Block a user