-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Preview logic requires tweaking #14983
Conversation
} | ||
|
||
const domEditablePaddingLeft = parseInt( computedStyle.paddingLeft.slice( 0, computedStyle.paddingLeft.length - 2 ) ); |
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.
Padding could be a non-integer. Also the parseInt()
and parseFloat()
functions parse the string until they encounter a non-numeric character so we do not need to trim the unit from the value.
const domEditablePaddingLeft = parseInt( computedStyle.paddingLeft.slice( 0, computedStyle.paddingLeft.length - 2 ) ); | |
const domEditablePaddingLeft = parseFloat( computedStyle.paddingLeft ); |
} ); | ||
|
||
expect( widgetToolbarRepository.isEnabled ).to.be.true; | ||
} ); | ||
|
||
it( 'should show preview with custom implementation', () => { |
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.
Those tests should not be inside the WidgetToolbarRepository#isEnabled
group.
const domEditable = editor.editing.view.domConverter.mapViewToDom( editable ); | ||
const computedStyle = window.getComputedStyle( domEditable ); | ||
const paddingLeftString = computedStyle.paddingLeft; | ||
const paddingLeft = parseInt( paddingLeftString.slice( 0, paddingLeftString.length - 2 ) ); |
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.
const paddingLeft = parseInt( paddingLeftString.slice( 0, paddingLeftString.length - 2 ) ); | |
const paddingLeft = parseFloat( paddingLeftString ); |
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 added few minor comments
Suggested merge commit message (convention)
Fix (clipboard): improve displaying preview in "drag and drop". Closes #14968.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.