fix: required validation not working after deleting data in rich text editor (#6006)

This commit is contained in:
Katherine 2025-01-08 16:10:53 +08:00 committed by GitHub
parent 35238cc02e
commit 5ce5b05cb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,13 @@ export const RichText = connect(
modules={modules}
formats={formats}
value={resultValue}
onChange={onChange}
onChange={(value) => {
if (value === '<p><br></p>') {
onChange(undefined);
} else {
onChange(value);
}
}}
readOnly={disabled}
/>,
);