-
Notifications
You must be signed in to change notification settings - Fork 58
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
Bolding text using the toolbar causes whitespace to be lost #1966
Comments
I see the Android demo app is not mentioned. Does the issue happen there too? From the looks of this, I'd suspect something on the RN/JS level is trimming the whitespace? Have you investigated there @guarani ? In particular, find out if trimming does happen intentionally or not, under which circumstances or assumptions and whether we can suppress that in this case. |
Are you referring to the Gutenberg demo/example Android project? Then yes – but let me know if you're referring to something else. It's been a while since I debugged this so I'll do that and write up a summary here. |
Where is this bug present?
Scenario 1 above – where tapping the bold button moves the cursor back to the beginning of the line – is "fixed" by commenting out the following code: |
Reopening to fix issue where whitespace is deleted on second and subsequent lines within a block. Fix coming here: wordpress-mobile/AztecEditor-iOS#1285 |
Device: Samsung Galaxy S9+ Although bolded text with spaces before it doesn't jump to the left in block editor, spaces are removed when viewing in the app or on web, though all is fine again in the P2 front edit: It appears correctly in the Reader: HTML: If you need any different info, please say (first post!). |
Description
When bolding text using the toolbar button on iOS or Android, any whitespace present at the beginning of the line is removed causing the the text to jump to the left and the whitespace to be lost. This affects the pre-formatted block, the verse block, and, to a lesser extent, the paragraph block. This issue is not present on Gutenberg web.
On iOS, bolding through the native iOS edit menu (the toolbar menu that displays selection options) is not affected by this bug.
The same bug is present for italics or strikethrough.
Steps to Reproduce
There are two distinct scenarios where this bug is present.
Scenario 1: Styling non-selected text
In a paragraph block, type some spaces, then tap the toolbar bold button and observe that the cursor jumps back to the start of the line. The cursor should stay put when the bold button is tapped.
Scenario 2: Styling selected text
Expected Behavior
Applying bold/italics/strikethrough to text should not affect leading whitespace or reposition the text in any way.
Devices
Additional Context
This bug is present in the Gutenberg editor in the WordPress for iOS app and in the Gutenberg example iOS and Android projects in this repo. It is not present on the Aztec for iOS example app or the WordPress for iOS Classic editor.
The text was updated successfully, but these errors were encountered: