-
Notifications
You must be signed in to change notification settings - Fork 55
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
Issue 1524/text with bullets #1534
Conversation
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.
I just tested it, and it works well! error 1 is fixed but error 2 is still there, the error 2 is about a bullet that never disappears when you revert the text.
Try this
- write a word with a bullet and save it. For example,
- hello
- try to give a change to that word, then you will see revert message next to the button, don't save it, but revert it.
- You will see the text you wrote with a bullet in number 1.
- try to remove a bullet by using slate and save it. For example,
hello
- refresh the page
- you will see that bullet is still there and impossible to remove it now
If you are unsure about error 2, let me know! I can show you also!
@kaulfield23 I couldn't fix the bug in Firefox so I will maintain that issue documented here #1540. Me and @richardolsson did some more improvements to the Text Editor performance so the PR is again ready to be reviewed. |
Nice!!😄 I really like the improvements! feels so good to be able to remove bullets! But I can't fully understand codes here so I want @richardolsson to double check it! |
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.
I have a question below. Regardless of the answer, I think this looks fine. @kaulfield23 if you're happy with how it works, I give you green light to merge!
if (node && Object.prototype.hasOwnProperty.call(node[0], 'children')) { | ||
if ( | ||
'children' in node[0].children[0] && | ||
Object.prototype.hasOwnProperty.call(node[0].children[0], 'children') | ||
) { |
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.
This seems unnecessarily complex to me. I realize you probably found this solution in the Slate issue tracker, but I'm curious if you know the reason for using hasOwnProperty.call(node[0]…
instead of node[0]?.hasOwnProperty(…
, etc?
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.
Yes, the reason I was implemented so complex it's because Ancestor
and the following types are a mixed of types. The reason to use hasOwnProperty.call
it's to avoid a lint error. If I use node[0]?.hasOwnProperty(…,
I get the error Do not access Object.prototype method 'hasOwnProperty' from target object
.
Description
This PR updates the dependencies
slate
andslate-react
that handles the text editor. It also fixes a text editor bugs reg regarding an error and the possibility to remove bullet item when it's on the root of the text editor.Screenshots
Video.sin.titulo.Hecho.con.Clipchamp.8.mp4
Video.sin.titulo.Hecho.con.Clipchamp.10.mp4
Changes
slate
dependency to version0.94.1
slate-react
dependency to version0.98.3
removeBackwards
to allow the user to remove a missing bullet point in the root of editor.Notes to reviewer
None
Related issues
Resolves #1524