Skip to content

Commit c12611d

Browse files
authored
Bugfix: prevent to show spurious warnings in dev panel console (#2204)
warnings occurs in Firefox Web dev panel console when some attribute in `Element.style` component are set to `undefined` regressed at commit 093b47b
1 parent ba15e06 commit c12611d

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/js/utils/floating-ui.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,11 @@ function floatingUIposition(step, shouldCenter) {
150150
*/
151151
function placeArrow(el, middlewareData) {
152152
const arrowEl = el.querySelector('.shepherd-arrow');
153-
if (arrowEl) {
154-
let left, top, right, bottom;
155-
156-
if (middlewareData.arrow) {
157-
const { x: arrowX, y: arrowY } = middlewareData.arrow;
158-
left = arrowX != null ? `${arrowX}px` : '';
159-
top = arrowY != null ? `${arrowY}px` : '';
160-
}
161-
153+
if (arrowEl && middlewareData.arrow) {
154+
const { x: arrowX, y: arrowY } = middlewareData.arrow;
162155
Object.assign(arrowEl.style, {
163-
left,
164-
top,
165-
right,
166-
bottom
156+
left: arrowX != null ? `${arrowX}px` : '',
157+
top: arrowY != null ? `${arrowY}px` : ''
167158
});
168159
}
169160
}

0 commit comments

Comments
 (0)