Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Loading saved images with stretched config doesn't work

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Reproduce the issue by creating an EditorJS instance with the supplied data object and checking the rendered blocks. Inspect how the image block handles its stretched setting and compare it with the paragraph receiving the ce-block--stretched class; done means the image with stretched: true receives the expected stretched styling without affecting another block.

Written by the indexing model from the issue text.

Description

Try passing this object in the data field when the constructor is called with const editor = new EditorJS({}))

{
    "time": 1600668389224,
    "blocks": [
        {
            "type": "image",
            "data": {
                "url": "https://cdn.pixabay.com/photo/2017/09/01/21/53/blue-2705642_1280.jpg",
                "caption": "Here is a caption field",
                "withBorder": false,
                "withBackground": true,
                "stretched": false
            }
        },
        {
            "type": "paragraph",
            "data": {
                "text": "hellow orld"
            }
        },
        {
            "type": "paragraph",
            "data": {
                "text": "hello world"
            }
        },
        {
            "type": "image",
            "data": {
                "url": "https://cdn.pixabay.com/photo/2017/09/01/21/53/blue-2705642_1280.jpg",
                "caption": "adsad",
                "withBorder": false,
                "withBackground": false,
                "stretched": true
            }
        }
    ],
    "version": "2.18.0"
}

The third block, i.e. paragraph ' hello world ' will get the ce-block--stretched class applied to it and the image below it won't.

But, the settings icon for stretched is toggled. Other settings work fine.

What's the issue?

Dominant language
JavaScript
Stars
29
Forks
22
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from editor-js/simple-image-tutorial

All issues in editor-js/simple-image-tutorial

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.