codex-team / codex-team/editor.js

Stretched not working as expected on editorjs

Open
#2,930 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Create a simple instance of editorjs and try to set all elements to stretched.
The elements are stretched but the editorjs does not respect the width, it shows the toolbox in the wrong place.

Below is my code to set all elements to stretched.

```
const stretch = () =>{
if(editor.value) {
stretched.value = !stretched.value
const blocks = editor.value.blocks as Blocks
const count = editor.value.blocks.getBlocksCount()
for (let i = 0; i < count; i++) {
const block = blocks.getBlockByIndex(i)
if (block) {
block.stretched = stretched.value
}
}
}
}
```

Here is an image of how it looks like after all elements are stretched.

In red is where the options appear, in blue is where it should go.

Image

In addition, is there any option to set globally where new elements are stretched by default?

As a workaround I can use css, but I am looking for a way to store the `stretched` value for each block separately, hence next time all elements are shown accordingly.

Version: `"@editorjs/editorjs": "^2.30.8"`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.