Skip to content

Fix bugs initializing stretched and pasted tables. - #190

Open
btrewern wants to merge 4 commits into
editor-js:masterfrom
btrewern:stretched-fix
Open

Fix bugs initializing stretched and pasted tables.#190
btrewern wants to merge 4 commits into
editor-js:masterfrom
btrewern:stretched-fix

Conversation

@btrewern

Copy link
Copy Markdown
Contributor

This fixes the following:

  • Table is not initialised correctly if stretch is selected.
  • Cannot correctly stretch pasted table.

(using stretched-fix branch)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issues with the table tool’s “stretched” mode not being applied correctly on initial render and behaving incorrectly after pasting tables, by syncing the tool’s persisted data.stretched state with the Editor.js block’s stretched UI state.

Changes:

  • Adds a post-render hook to apply data.stretched to the Editor.js block once the block is mounted.
  • Centralizes tune activation handling via _updateTunes() and triggers a block change dispatch when tunes are toggled.
  • Ensures pasted table data includes a stretched field (but currently resets it unconditionally).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/plugin.js
Comment on lines 250 to 254
this.data = {
withHeadings: firstRowHeading !== null,
stretched: false,
content
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants