-
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
List Block fixes for iOS. #863
Conversation
👋 , when running
Any tips for how to get past that? |
Not sure if it upgraded but it was a reinstall (brew uninstall/install carthage) |
I should have added that the build works OK for me on develop, not sure if it adds any important information. So, it's only on this PR that the build error appears. |
Update: I can confirm that re-installing ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the fix and can verify that it is indeed fixing the issue! 🎉
Haven't done any code level passes on the actual fix though and I will that to @diegoreymendez and other iOS experts.
By the way, there's an issue with creating new list items when there are nested lists that happens under some conditions but I think it's not introduced by this PR. It appears both on Android and iOS alike. Here's the ticket: #874
The Aztec-iOS side PR was merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etoledom - I managed to crash this PR (once) following these steps:
- Create the specified block.
- Switch back to visual.
- Place caret at the end of "line 32".
- Press enter once.
- Type something, and press SHIFT + TAB to de-indent the current (new) bullet.
- Press ENTER
I can no longer crash it but there is undoubtedly some strange behavior.
I'm not sure what the cause is but I'd imagine this type of block may require changes in how we intercept ENTER events. I added the above review as a comment as you may decide this is something to tackle incrementally. |
Thank you @diegoreymendez ! I saw a crash on enter on another multi paragraph instance of RichText here (first iOS issue described): WordPress/gutenberg#14883 (review) I don't know if they are related but it might be. I'll check that out! |
@diegoreymendez @hypest - Indentation and outdentation via Tab / Shift + Tab is definitely broken on Aztec-iOS. Example indent:From this initial HTML: <ul>
<li>Hello</li>
<li>world</li>
</ul> Pressing Tab in the last list item we should get this: <ul>
<li>Hello
<ul>
<li>world</li>
</ul>
</li>
</ul> But we get this: <ul>
<li>Hello</li>
<li>
<ul>
<li>world</li>
</ul>
</li>
</ul> Example undent:Starting from this HTML: <ul>
<li>Hello
<ul>
<li>world</li>
</ul>
</li>
</ul> Pressing Shift + Tab in the indented list item we should get the original: <ul>
<li>Hello</li>
<li>world</li>
</ul> But we get: <ul>
<li>Hello </li>
world
</ul> From there is clear that any inconsistency passed to Aztec could cause an out of bounds exception. Even though I haven't been able to crash it yet. But we know that it can happen from @diegoreymendez 's experience. I think that the correct solution for gutenberg would be to intercept this key bindings and use the Gutenberg's Maybe we could just deactivate the bindings on Aztec Wrapper and work on indentation in a second iteration? I'll still try to work on a solution on Aztec-iOS level. I have created a PR with breaking Unit Tests here: |
Sounds good to me. We've already removed the toolbar buttons for nesting the list since it's not well supported yet so, makes sense to also disable the keyboard path to them. |
Agreed, getting closer to handling this as the web via the format-lib is what I'd personally prefer too. |
Just to clarify, my comments above were just to give visibility to the problem. I'm 100% fine with any direction chosen by you and @hypest to move this forward (ie: it's not my intention to comment on that). |
Thank you @diegoreymendez ! It was great to rise the issue 😁 @hypest if we are fine with this fix. We just need the ✅ to merge. |
The Aztec reference has been already updated to a later point via this PR: #889 So merging the current PR is not longer needed. |
Fixes #886
This PR implements changes on Aztec-iOS that fix an issue on the block list.
There is a related gutenberg side PR needed to fix an issue pressing enter on List blocks.
Issue:
After the fix:
To test: