Skip to content

Commit

Permalink
Bugfix: prevent to show spurious warnings in dev panel console (#2204)
Browse files Browse the repository at this point in the history
warnings occurs in Firefox Web dev panel console when some attribute in `Element.style` component are set to `undefined`

regressed at commit 093b47b
  • Loading branch information
SamyCookie committed Jan 17, 2023
1 parent ba15e06 commit c12611d
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/js/utils/floating-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,11 @@ function floatingUIposition(step, shouldCenter) {
*/
function placeArrow(el, middlewareData) {
const arrowEl = el.querySelector('.shepherd-arrow');
if (arrowEl) {
let left, top, right, bottom;

if (middlewareData.arrow) {
const { x: arrowX, y: arrowY } = middlewareData.arrow;
left = arrowX != null ? `${arrowX}px` : '';
top = arrowY != null ? `${arrowY}px` : '';
}

if (arrowEl && middlewareData.arrow) {
const { x: arrowX, y: arrowY } = middlewareData.arrow;
Object.assign(arrowEl.style, {
left,
top,
right,
bottom
left: arrowX != null ? `${arrowX}px` : '',
top: arrowY != null ? `${arrowY}px` : ''
});
}
}
Expand Down

0 comments on commit c12611d

Please sign in to comment.