We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Scaling a view within the Grid causes incorrect overlay.
Grid
I attempted to manipulate the zIndex by wrapping my Grid Item View in a ZStack and changing the zIndex whenever that particular view scaled.
zIndex
Grid Item View
ZStack
However, it does not appear to have any effect.
Here is a sample code snippet of my Grid implementation:
var body: some View { Grid(tracks: layout.tracks) { ForEach(viewModel.items, id: \.self) { item in ZStack { LayoutItem(item, action: { action in viewModel.handle(action, for: item) }) } .zIndex(item.zIndex) .gridSpan(column: item.type.column, row: item.type.row) } } .gesture(drag) .coordinateSpace(name: GridLayout.NAME_SPACE) }
Here is a code snippet of my toggle scale logic
public func handle(drag location: CGPoint?) { for var item in items { var inBounds = false var scale: GridLayoutItemScale = .normal var zIndex: Double = 0 if let location = location { inBounds = item.bounds.contains(location) scale = inBounds ? .large : .normal zIndex = inBounds ? 1 : 0 } item.scale = scale item.zIndex = zIndex setItem(item) } }
I looked through the documentation and wasn't able to find anything specific to zIndex manipulation.
Is it possible to alter the zIndex for Grid Items within the Grid to avoid bottom overlay?
If not, it would be a great addition to this package! I've been using it a lot and it is FANTASTIC!
The text was updated successfully, but these errors were encountered:
+1 Would be super helpful for this to be implemented
Sorry, something went wrong.
+1 This ^^^
Up!
No branches or pull requests
Issue
Scaling a view within the
Grid
causes incorrect overlay.Description
I attempted to manipulate the
zIndex
by wrapping myGrid Item View
in aZStack
and changing thezIndex
whenever that particular view scaled.However, it does not appear to have any effect.
Details
Here is a sample code snippet of my
Grid
implementation:Here is a code snippet of my toggle scale logic
Demo
Conclusion
I looked through the documentation and wasn't able to find anything specific to
zIndex
manipulation.Is it possible to alter the
zIndex
for Grid Items within theGrid
to avoid bottom overlay?If not, it would be a great addition to this package! I've been using it a lot and it is FANTASTIC!
The text was updated successfully, but these errors were encountered: