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

The styling('Bold', 'cursive') is reset with each new line.(After enter is pressed) #194

Open
oleksandr-shymanskyi-yonder opened this issue Feb 20, 2024 · 1 comment

Comments

@oleksandr-shymanskyi-yonder

Hello,

Thanks a lot for the amazing Markup editor. It's been incredibly helpful.
I've encountered a peculiar behavior I would like to share.
Whenever I press 'Enter' on my iOS device, the styling seems to reset. Is it intentional behavior? Has anyone else experienced a similar issue?

I've tested this issue on both iOS 16 and iOS 17, using both an iPad and an iPhone, and the problem persists across all devices.

Here is the attached video:
https://github.com/stevengharris/MarkupEditor/assets/141324357/535532c1-5414-48ff-9d89-9051565edccb

@stevengharris
Copy link
Owner

This is an oversight and should be fixed. Internally, I call B, I , etc "formats" to distinguish them from P, H1, etc, which I refer to as "styles". FWIW, the intended behavior is that Enter from H1 and any other "style" creates a new, empty P. But, if the Enter occurred within a formatted element, it should be producing an empty "format" inside of it so that subsequent typing is formatted the same way.

It does actually work correctly if you split an existing formatted element by pressing Enter. So, if you place your selection in a the middle of a bold word and press enter, the paragraph splits and the selection is in the 2nd part of the split bolded word, and typing produces bold text. This leads me to believe it will be fixable by just detecting the condition properly and letting the existing code that's working for this other case do the job. OTOH, the logic around capturing Enter is complex because it needs to do different things depending on the context. For example, Enter within a list produces a new list item, but at the last list item will outdent until it can't outdent any longer and produces a new P.

@stevengharris stevengharris added this to the onorepo multiple codebase milestone Feb 20, 2024
@stevengharris stevengharris removed this from the onorepo multiple codebase milestone Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants