Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading More text after saving an empty text #23780

Closed
ntsekouras opened this issue Jul 8, 2020 · 4 comments
Closed

Misleading More text after saving an empty text #23780

ntsekouras opened this issue Jul 8, 2020 · 4 comments
Assignees
Labels
[Block] More Affects the More Block - used for displaying the 'Read More' link [Type] Bug An existing feature does not function as intended

Comments

@ntsekouras
Copy link
Contributor

Describe the bug
With the current behaviour of More block, if we change the text to an empty string and update, we will save an undefined value. This leads into taking the default value of More block that is Continue Reading.

So if we refresh the page later will show the JS default value: Read more but actually doesn't have a value.

To reproduce
Steps to reproduce the behavior:

  1. Go to a post and add a More block
  2. Empty the More text and update
  3. Refresh the page and watch that Read more is shown
  4. View the post's category page in front end and watch that Continue Reading is shown

Expected behavior
A user shouldn't be able to save an empty text for More block. On focusing out the input, it should change to the default JS value Read more.

Screenshots
Screenshot
When we save.

Screenshot(2)
After reloading the post

Screenshot(1)
What is shown in front-end

@ntsekouras ntsekouras added [Type] Bug An existing feature does not function as intended [Block] More Affects the More Block - used for displaying the 'Read More' link labels Jul 8, 2020
@ntsekouras ntsekouras self-assigned this Jul 8, 2020
@ntsekouras ntsekouras mentioned this issue Jul 8, 2020
6 tasks
@mcsf
Copy link
Contributor

mcsf commented Jul 8, 2020

Steps to reproduce the behavior:

  1. Go to a post and add a More block
  2. Empty the More text and update
  3. Refresh the page and watch that Read more is shown
  4. View the post's category page in front end and watch that Continue Reading is shown

As a user, what did you expect to happen in the editor once you emptied the text input? And in the front end?

@mcsf
Copy link
Contributor

mcsf commented Jul 8, 2020

The More block was added fairly early on in the development of Gutenberg and it sought to mimic the functionality provided with TinyMCE. This explains why it's such a simple block and why its editor view is so detached from the front-end result.

It's also a block that doesn't tend to receive a lot of attention, and so it has remained like this for a long time.

More importantly, until Phase 2, Gutenberg has only concerned itself with the post_content. Thus, it made sense to render More as a very discreet line, because the rendered post will have no visual cue at all.

However, as we move into full-site editing (FSE) territory, it will probably be good to revisit More in such a way that it can behave differently depending on the editing content:

  • When editing a single post (like today), More should merely appear as a dashed line (like today).
  • In FSE, when editing a page that has a list of posts (e.g. an archive view), the More blocks corresponding to each post should be rendered faithfully (i.e. an actual button matching the theme).
  • The same situation applies when using the Query block : it should be possible to render faithful More blocks among the blocks nested in Query.

Ideally, the FSE work with More in mind would make it easier to determine what the server-side $more_link_text will be in the case of an absent customText value for the More block. And then we won't have to hack the value of customText as initially attempted in #23758. :)

@ntsekouras
Copy link
Contributor Author

As a user, what did you expect to happen in the editor once you emptied the text input? And in the front end?

Probably be empty both at admin and front-end.

@ntsekouras
Copy link
Contributor Author

I'm closing this issue as it seems FSE development/evolution is a better place to revisit, maybe reinvent, as described by @mcsf above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] More Affects the More Block - used for displaying the 'Read More' link [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants