Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a4bb7c

Browse filesBrowse files
authored
fix(ios): shadow does not consider z-index (NativeScript#10433)
1 parent 9fae9c4 commit 5a4bb7c
Copy full SHA for 5a4bb7c

File tree

Expand file treeCollapse file tree

2 files changed

+10
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-3
lines changed

‎packages/core/ui/core/view/index.ios.ts

Copy file name to clipboardExpand all lines: packages/core/ui/core/view/index.ios.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,13 @@ export class View extends ViewCommon implements ViewDefinition {
864864
return 0;
865865
}
866866
[zIndexProperty.setNative](value: number) {
867-
this.nativeViewProtected.layer.zPosition = value;
867+
const nativeView: NativeScriptUIView = <NativeScriptUIView>this.nativeViewProtected;
868+
869+
nativeView.layer.zPosition = value;
870+
// Apply z-index to shadows as well
871+
if (nativeView.outerShadowContainerLayer) {
872+
nativeView.outerShadowContainerLayer.zPosition = value;
873+
}
868874
}
869875

870876
[backgroundInternalProperty.getDefault](): UIColor {

‎packages/core/ui/styling/background.ios.ts

Copy file name to clipboardExpand all lines: packages/core/ui/styling/background.ios.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export namespace ios {
143143
}
144144

145145
if (!needsMask) {
146-
clearLayerMask(nativeView, background);
146+
clearLayerMask(nativeView);
147147
}
148148

149149
// Clear box shadow if it's no longer needed
@@ -345,7 +345,7 @@ function maskLayerIfNeeded(nativeView: NativeScriptUIView, background: Backgroun
345345
}
346346
}
347347

348-
function clearLayerMask(nativeView: NativeScriptUIView, background: BackgroundDefinition) {
348+
function clearLayerMask(nativeView: NativeScriptUIView) {
349349
if (nativeView.outerShadowContainerLayer) {
350350
nativeView.outerShadowContainerLayer.mask = null;
351351
}
@@ -1127,6 +1127,7 @@ function drawBoxShadow(view: View): void {
11271127
outerShadowContainerLayer.bounds = bounds;
11281128
outerShadowContainerLayer.anchorPoint = layer.anchorPoint;
11291129
outerShadowContainerLayer.position = nativeView.center;
1130+
outerShadowContainerLayer.zPosition = layer.zPosition;
11301131

11311132
// Inherit view visibility values
11321133
outerShadowContainerLayer.opacity = layer.opacity;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.