-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix: make TextAlign defaultAlignment setting work as expected #3460
Conversation
❌ Deploy Preview for tiptap-embed failed.
|
Apologies -- I am new to pull requests and a bit confused. If someone could explain the automatic messages here and let me know what further action is needed from me, I'd greatly appreciate 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.
needs to modify
@@ -41,10 +41,6 @@ export const TextAlign = Extension.create<TextAlignOptions>({ | |||
default: this.options.defaultAlignment, | |||
parseHTML: element => element.style.textAlign || this.options.defaultAlignment, | |||
renderHTML: attributes => { | |||
if (attributes.textAlign === this.options.defaultAlignment) { |
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 think the idea here was to not add any style attributes to the element when the alignment is equal to the default alignment.
If we remove this, there's no way to get rid of alignment inline styles without removing a node first even though they are mostly not needed.
I think the only issue that could come up with this is, that the text alignment can diverge from the default because of a wrapping element that updates the text alignment and passes it down via inheritance but this is expected browser behaviour I'd say?
Open for discussion on this one.
Moved this to #5891 |
Proposed fix to resolve #3459