how to get the current focused td #1116
Answered
by
SunnyCheung-cp
SunnyCheung-cp
asked this question in
Q&A
-
I want to add an options menu on td iShot_2023-09-11_15.40.22.mp4 |
Beta Was this translation helpful? Give feedback.
Answered by
SunnyCheung-cp
Sep 18, 2023
Replies: 1 comment 1 reply
-
You can get the rect by import { selectedRect } from '@milkdown/prose/tables';
editor.action((ctx) => {
const state = ctx.get(editorStateCtx);
// See also:
// https://github.com/ProseMirror/prosemirror-tables/blob/b569c2f9f63cb27eed6ada0bfd51ff434a03213b/src/commands.ts#L30
const rect = selectedRect(state);
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Saul-Mirone Thank you for your help, It looks great
iShot_2023-09-18_16.12.45.mp4