From bb4345486742fbd1214125cf6d6ad57e7f280d6d Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Wed, 2 Mar 2022 23:18:15 +0900 Subject: [PATCH] =?UTF-8?q?:bug:=20#text-input=E3=81=AEReact=E3=81=AE?= =?UTF-8?q?=E5=86=85=E9=83=A8=E6=A7=8B=E9=80=A0=E3=81=AE=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E9=9A=8F=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/dom/caret.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/dom/caret.ts b/browser/dom/caret.ts index ef1cfa0..847c0b0 100644 --- a/browser/dom/caret.ts +++ b/browser/dom/caret.ts @@ -26,7 +26,7 @@ export interface CaretInfo { /** 選択範囲の位置 */ selectionRange: Range; } -interface ReactInternalInstance { +interface ReactFiber { return: { return: { stateNode: { @@ -48,15 +48,15 @@ export function caret(): CaretInfo { } const reactKey = Object.keys(textarea) - .find((key) => key.startsWith("__reactInternalInstance")); + .find((key) => key.startsWith("__reactFiber")); if (!reactKey) { throw Error( - "div.cursor must has the property whose name starts with `__reactInternalInstance`", + 'div.cursor must has the property whose name starts with "__reactFiber"', ); } // @ts-ignore DOMを無理矢理objectとして扱っている return (textarea[ reactKey - ] as ReactInternalInstance).return.return.stateNode.props; + ] as ReactFiber).return.return.stateNode.props; }