GithubHelp home page GithubHelp logo

Comments (2)

t-hamano avatar t-hamano commented on June 18, 2024

I think this is because there's a process to ensure that caption text isn't overwritten by an empty caption.

// If a caption text was meanwhile written by the user,
// make sure the text is not overwritten by empty captions.
if ( captionRef.current && ! mediaAttributes.caption ) {
const { caption: omittedCaption, ...restMediaAttributes } =
mediaAttributes;
mediaAttributes = restMediaAttributes;
}

Do you think this process is unnecessary?

from gutenberg.

afercia avatar afercia commented on June 18, 2024

I understand the intent of that check but seems to me it is based on an assumption. To me, it is only valid in a scenario where the user has written a new caption and it is still making a decision on what image to use or wants to replace the image with one that fits with the existing caption. Maybe they are trying various images and in that case it makes sense to not lose the caption. But this is an assumption on a single case.

As a user, when I replace an image with a new one that has its own caption, I expect the caption to be there.

Edit: Also, comparing the behavior with the one that always existed in WordPress and now it's in the Classic editor, this is a change in the expected behavior that should have been considered a little more deeply IMHO.

from gutenberg.

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.