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

Latest Comment block having issue with typography in editor side. #68876

Closed
NidhiDhandhukiya74 opened this issue Jan 24, 2025 · 7 comments
Closed
Labels
[Block] Latest Comments Affects the Latest Comments Block [Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended

Comments

@NidhiDhandhukiya74
Copy link

Description

Latest Comment block having issue with typography in editor side.
I have checked this in Twenty Twenty three and in Twenty Twenty theme.

Step-by-step reproduction instructions

  1. Use Latest Comment block.
  2. Change font size from the typography.

Expected behaviour

When we change the font size then it should be applied to the Latest comment block font size.

Actual behaviour

When we change the font size then it should not be applied to the Latest comment block font size.
when we refresh the page then come back so the previous applied font size is worked but not working on change.

WordPress information

  • WordPress version: Version 6.7.1
  • Are all plugins except Gutenberg deactivated? - Yes
@NidhiDhandhukiya74 NidhiDhandhukiya74 added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Jan 24, 2025
@dcalhoun dcalhoun added [Type] Bug An existing feature does not function as intended and removed Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Jan 24, 2025
@t-hamano
Copy link
Contributor

I can't reproduce this issue, am I missing some step?

f5717e94dad03194d5c8c29fe6db59ad.mp4

@t-hamano t-hamano added [Status] Needs More Info Follow-up required in order to be actionable. [Block] Latest Comments Affects the Latest Comments Block labels Jan 25, 2025
@Rishit30G
Copy link
Contributor

Rishit30G commented Jan 27, 2025

Thanks for sharing the issue,

But even I couldn't see the issue on my local, everything seems to be working fine, sharing the screencast for the same:

Theme: Twenty Twenty
WordPress: 6.7.1

Screen.Recording.2025-01-27.at.10.08.36.AM.mov

@shail-mehta
Copy link
Member

@NidhiDhandhukiya74 Could you please share a screen recording here? Also, could you please check with different default themes and let us know?

Based on the comments above, the issue cannot be reproduced in Gutenberg.

@NidhiDhandhukiya74
Copy link
Author

Hello everyone,

I missed one important step to reproduce the issue: apply alignment first. The font-size setting doesn’t work when alignment is used.
I’ve attached a video for better understanding.

Edit.Page.guteberg.test.woodward-exersie.WordPress.mp4

@t-hamano
Copy link
Contributor

t-hamano commented Feb 7, 2025

Thank you, I was able to reproduce this issue.

The underlying problem is likely the same as the following issues:

This issue probably needs to be fixed in the ServerSideRender component itself, not in each block.

See #64986 (review) for more details.

@coder-rancho
Copy link

coder-rancho commented Feb 10, 2025

Hey @t-hamano, I was debugging the issue. Here are my findings:

  1. The changes in attributes are only reflected for the first time when block is added to the editor. Once we save the post and refresh the page, the changes in attributes are still saved in backend but not reflected on UI in real time. Demo:
Screen.Recording.2025-02-10.at.9.01.59.PM.mov
  1. Here at #64986 (review), you've mentioned that the fetchData() function is not called from debouncedFetchData() function. This is happening because fetchData() is redefined for each render. Every render created a new fetchData function, causing useDebounce to reset its timer continuously. The debounced callback was therefore never allowed to fire. To fix this, we can define fetchData inside useCallback. But this will not fix the problem as I tried already.

  2. The behaviour of ServerSideRender component was almost identical for both blocks ( i.e. The block that was added for the first time in the editor and the block that was added before we refresh the editor ). All the logs, all the function calls were identical.

One more thing that I noticed while using useCallback with fetchData function is that the attributes value in fetchResponse was not updated. But when I use fetchData without debounce or useCallback, the fetchResponse receives updated attributes value.

@t-hamano
Copy link
Contributor

I have abstracted this problem and submitted it as #69220. Therefore, let's close this issue.

@t-hamano t-hamano closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Comments Affects the Latest Comments Block [Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants