BREAKING(overlays): make elevation prop setter param type number instead of string

This commit is contained in:
jorenbroekema 2022-02-21 10:30:00 +01:00
parent 683d5c1c9c
commit b96dc40ebe
3 changed files with 9 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/overlays': minor
---
BREAKING: elevation property setter on OverlayController accepts numbers only, previously this was a number as a string. This syncs it with the getter which returns a number.

View file

@ -416,14 +416,14 @@ export class OverlayController extends EventTargetShim {
} }
/** /**
* @param {string} value * @param {number} value
*/ */
set elevation(value) { set elevation(value) {
if (this.contentWrapperNode) { if (this.contentWrapperNode) {
this.contentWrapperNode.style.zIndex = value; this.contentWrapperNode.style.zIndex = `${value}`;
} }
if (this.backdropNode) { if (this.backdropNode) {
this.backdropNode.style.zIndex = value; this.backdropNode.style.zIndex = `${value}`;
} }
} }

View file

@ -113,7 +113,7 @@ export class OverlaysManager {
.reverse() .reverse()
.forEach((ctrl, i) => { .forEach((ctrl, i) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
ctrl.elevation = `${i + 1}`; ctrl.elevation = i + 1;
}); });
} }