-
Notifications
You must be signed in to change notification settings - Fork 281
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: Calculate the offsetHeight for the toolbar only when the table is used #1543
Conversation
@orsolyaDekany Is the bug reproducible in other places where we use alloy editor, or is it specific only to web content on 7.3? I couldn't reproduce it on |
3a85fec
to
84226ed
Compare
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.
@orsolyaDekany see comment inline, and also #1543 (comment)
84226ed
to
c18bed5
Compare
Hi @markocikos , In the meantime, I also added |
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.
@orsolyaDekany almost good to go! Please see comment inline.
src/selections/selection-position.js
Outdated
@@ -56,7 +56,7 @@ const centerToolbar = function(toolbar, rect) { | |||
if (startContainer.$.nodeType !== Node.ELEMENT_NODE) { | |||
startContainer = startContainer.getParent(); | |||
} | |||
if (startContainer) { | |||
if (startContainer.$.nodeName === "TD" || startContainer.$.nodeName === "TH") { |
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.
It looks like this actually fixes a small bug in master
, where a text line (paragraph) followed by an image causes wrong positioning. Awesome! I'll trust you that this also fixes the 7.3 bug from the ticket.
Before merging, we should just tidy this a bit. Please move node name to a variable, use single quotes, break line if needed. If you followed setup, you can use yarn format
(and yarn test
for doublecheck).
b32d3c7
to
13ed931
Compare
13ed931
to
f7b3675
Compare
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.
LGTM!
Hi Team,
Issue: #1542
LPS: https://issues.liferay.com/browse/LPS-166604
The issue is not reproduceable before this commit.
Fix: the offsetHeight is calculated only when the toolbar is positioned for the table
With the fix, the toolbar is positioned again on top of each image and also on top of every cell/row in a table that is currently selected.
Could you please review it?
cc. @markocikos