Ctrl+A, Ctrl+Z, Ctrl+Y Key takes more time #4478
-
DescriptionCtrl+A, Ctrl+Z, Ctrl+Y Takes More Time. If I press Ctrl+A, It takes more time to select, in the same way Ctrl+Z and Ctrl+Y keys are also taking time to undo and redo. Where and in which code it has to be fixed to make it work properly? Reproduction URLNo response Reproduction steps1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error Plate version44.0.1 Slate React version0.102.0 ScreenshotsLogsBrowsersNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @manojrampur-tiger! I'm Dosu and I’m helping the plate team. The slowness with Ctrl+A, Ctrl+Z, and Ctrl+Y is usually tied to how Plate and Slate handle keyboard shortcuts and document state. Undo/redo (Ctrl+Z, Ctrl+Y) are managed by Slate’s history plugin, mainly in Ctrl+A (select all) is handled by the browser’s contenteditable, but if your document is large or deeply nested, selection can lag. Plate does not override this, but plugins that add selection logic (like block selection) can impact performance. Recent Plate updates introduced optimizations for block selection, e.g. To improve performance, check for heavy or misconfigured plugins, custom keyboard handlers, or large document structures. Try profiling with browser devtools to see where the bottleneck is. If possible, isolate plugins or reduce document size to pinpoint the cause discussion. If you need to dig deeper, focus on optimizing plugin logic and document structure, or look into Slate’s history stack management for undo/redo. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
The slowness with Ctrl+A, Ctrl+Z, and Ctrl+Y is likely due to how Plate and Slate handle selection and undo/redo, especially with large documents or complex tables.
Performance can also be affected by plugin misconfiguration, plugin order, or custom To improve performance, profile your document size, check for unnecessary plugins or custom handlers, and consider optimizing how large tables or blocks are rendered. If the bottleneck is in Slate’s core transforms or history, deeper optimization may be needed there. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
The slowness with Ctrl+A, Ctrl+Z, and Ctrl+Y is likely due to how Plate and Slate handle selection and undo/redo, especially with large documents or complex tables.
Ctrl+A (select all) is handled in Plate’s
SlateReactExtensionPlugin
via anonKeyDown
handler, but the actual selection logic relies on Slate’s selection transforms. If your document is large, the selection operation can be slow because it traverses the entire node tree. You can find this logic in Plate’sSlateReactExtensionPlugin
andhotkeys.ts
for shortcut detection, but the heavy lifting is in Slate’s transforms and selection logic see source.Ctrl+Z (undo) and Ctrl+Y (redo) are managed by Plate’s
HistoryPlugin
, which s…