Giter Site home page Giter Site logo

Comments (3)

ichim-david avatar ichim-david commented on August 25, 2024

Take the Image Block for example.
You have the generation of sizes gives certain options enabled
https://github.com/plone/volto/blob/main/packages/volto/src/components/manage/Blocks/Image/View.jsx#L70
https://github.com/plone/volto/blob/main/packages/volto/src/components/manage/Blocks/Image/utils.js#L13
When you add an image you see selected 2 options
The L size
and the Center align
That selection is fake actually because they are added as missing value defaults.

Since we store widget options within the data object, the data is empty and any code that checks for it will not find it.

The solution for instance to get the value "l" present in the data is to add here
https://github.com/plone/volto/blob/main/packages/volto/src/components/manage/Blocks/Image/schema.js#L83
default: 'l'.

Doing so the image size is set correctly and it shows up in the data as seen in this screenshot where I had default value 'm' to ensure that there is no fallback value selected:
image-default

EDIT:
Unless there is a widget value added to the data object which happens when you set a default in the schema, the sizes will return undefined which judging by the looks of the options selected it should have selected sizes: "100vw".

from volto.

ichim-david avatar ichim-david commented on August 25, 2024

@sneridagh have a look when you have time to the comment I left above

from volto.

tiberiuichim avatar tiberiuichim commented on August 25, 2024

this should have a default value of "l"

from volto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.