Parcourir la source

:art: fix https://github.com/siyuan-note/siyuan/issues/11084

Vanessa il y a 1 an
Parent
commit
a945cf9c18
1 fichiers modifiés avec 9 ajouts et 2 suppressions
  1. 9 2
      app/src/protyle/render/av/openMenuPanel.ts

+ 9 - 2
app/src/protyle/render/av/openMenuPanel.ts

@@ -848,6 +848,7 @@ export const openMenuPanel = (options: {
                 } else if (type === "updateColType") {
                     if (target.dataset.newType !== target.dataset.oldType) {
                         const name = (avPanelElement.querySelector('.b3-text-field[data-type="name"]') as HTMLInputElement).value;
+                        data.view.columns.find((item: IAVColumn) => item.id === options.colId).type = target.dataset.newType as TAVCol;
                         transaction(options.protyle, [{
                             action: "updateAttrViewCol",
                             id: options.colId,
@@ -899,10 +900,16 @@ export const openMenuPanel = (options: {
                                     blockID
                                 }]);
                             }
-
                         }
                     }
-                    avPanelElement.remove();
+                    menuElement.innerHTML = getEditHTML({
+                        protyle: options.protyle,
+                        data,
+                        colId: options.colId,
+                        isCustomAttr
+                    });
+                    bindEditEvent({protyle: options.protyle, data, menuElement, isCustomAttr, blockID});
+                    setPosition(menuElement, tabRect.right - menuElement.clientWidth, tabRect.bottom, tabRect.height);
                     event.preventDefault();
                     event.stopPropagation();
                     break;