🎨 数据库单选/多选的选项不能为空

This commit is contained in:
Vanessa 2023-10-30 10:14:41 +08:00
parent e280517002
commit 3cc5644991
2 changed files with 2 additions and 2 deletions

View file

@ -279,7 +279,7 @@ export const bindEditEvent = (options: { protyle: IProtyle, data: IAV, menuEleme
return true;
}
});
if (hasSelected) {
if (hasSelected || !addOptionElement.value) {
return;
}
colData.options.push({

View file

@ -118,7 +118,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
let name = target.parentElement.dataset.name;
let color = target.parentElement.dataset.color;
const menu = new Menu("av-col-option", () => {
if (name === inputElement.value) {
if (name === inputElement.value || !inputElement.value) {
return;
}
transaction(protyle, [{