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

Paragraph block text capitalize #67736

Conversation

karthick-murugan
Copy link
Contributor

What?

Fixes #63261

The issue was that the keyboard doesn't start capitalized (uppercase) in the paragraph block on iOS web.

Why?

The paragraph block did not show the keyboard in uppercase mode by default, causing an inconsistency with expected behavior when typing.

How?

The fix I’ve implemented ensures that the first letter of the paragraph text is capitalized when the block is focused. This is achieved by modifying the content of the paragraph block when the user starts typing. However, instead of making the entire keyboard input uppercase, I have implemented a solution where the first letter of the content is capitalized. The solution applies for all web and mobile devices and not only for IOS.

I’m not sure whether this is the ideal solution, as the original request was to ensure the keyboard itself starts in uppercase mode. I’d appreciate feedback from reviewers and commenters on whether this approach is acceptable or if a different solution is needed.

Testing Instructions

  • Open a post or page in the WordPress editor.
  • Insert a paragraph block.
  • Focus on the paragraph block.
  • Start typing in the paragraph block and verify that the first letter of the text is automatically capitalized.
  • Confirm that the text behavior is consistent across devices, specifically on iOS web.

Testing Instructions for Keyboard

Screenshots or screencast

REC-20241209171358.mp4

Copy link

github-actions bot commented Dec 9, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: karthick-murugan <karthickmurugan@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: dcalhoun <dpcalhoun@git.wordpress.org>
Co-authored-by: sarthaknagoshe2002 <sarthaknagoshe2002@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended Mobile Web Viewport sizes for mobile and tablet devices Browser Issues Issues or PRs that are related to browser specific problems labels Jan 13, 2025
@Mamaduka
Copy link
Member

@karthick-murugan, I don't think this is the right way to resolve this issue. Why?

  • The proposed solution only "solves" the problem for the Paragraph block, but other blocks are probably also affected.
  • It forces specific behavior. What if the user wants to type lowercase text intentionally?
  • The problem must be resolved at a lower level, probably RichText.

Based on this, I think we can close this PR and try to track down the actual cause of the problem.

@dcalhoun
Copy link
Member

@Mamaduka I agree with your assessment of this pull request.

For additional context, I believe I identified the root cause. Unfortunately, I am unsure of the appropriate fix at this time, as it seems there is a fair bit of browser-specific complexity involved with the related code.

@Mamaduka
Copy link
Member

Thanks for confirmation, @dcalhoun!

@karthick-murugan
Copy link
Contributor Author

Thanks @Mamaduka and @dcalhoun for the detailed explanation. I am closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems Mobile Web Viewport sizes for mobile and tablet devices [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS (web): keyboard doesn't start capitalised (uppercase)
3 participants