diff --git a/src/component/PopupRoot.tsx b/src/component/PopupRoot.tsx index 14f6830..f7c30ed 100644 --- a/src/component/PopupRoot.tsx +++ b/src/component/PopupRoot.tsx @@ -194,9 +194,9 @@ export function PopupRoot({ const parentElement = tabDiv; const boundaryElement = tabDiv; const lastScaleKey = getPref("lastScaleKey") as string; - const lastScale = getItem(lastScaleKey); + const [lastScale, setLastScale] = useState(getItem(lastScaleKey)); const lastScaleItemKey = getPref("lastScaleItemKey") as string; - const lastScaleItem = getItem(lastScaleItemKey); + const [lastScaleItem, setLastScaleItem] = useState(getItem(lastScaleItemKey)); if (isDebug()) boundaryElement.style.border = "1px solid red"; @@ -431,6 +431,8 @@ export function PopupRoot({ const clickMeButtonRef = React.useRef(null); const vars = [ + lastScale, + lastScaleItem, exAction, sScale, sScaleAction, @@ -1112,13 +1114,21 @@ export function PopupRoot({ > {!params.ids && lastScale && lastScale.parentKey == item.key && ( <> - 量表: {lastScale.annotationText.substring(0, 30)}
量表: {lastScale.annotationText.substring(0, 30)} +
{ScaleActionTypeArray.map((a) => (
- {lastScaleItem && lastScale.parentKey == item.key && ( + {lastScaleItem && lastScaleItem.parentKey == item.key && ( <> - item:{lastScaleItem.annotationText.substring(0, 30)} +
item:{lastScaleItem.annotationText.substring(0, 30)} +
- {" "} + {ScaleItemActionTypeArray.map((a) => (