-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
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
Add GeometryReader
implementation
#239
Conversation
I can work on implementing the features outlined in that issue |
I started some preliminary work on that, or do you have some code already? |
No, I hadn’t started yet. |
No worries, I'll try to get some draft of that today. |
…okamak into geometry-reader # Conflicts: # Sources/TokamakCore/MountedViews/MountedCompositeView.swift # Sources/TokamakDemo/TokamakDemo.swift
This is working for me now in isolated example code, but layout bugs exposed by our demo code prevent this from being added to the demo. @carson-katri @j-f1 lmk if you think it would be fine merging this as is and adding a |
IMO if it's a small bug or something that prevents building it shouldn't be merged in general. But if it's more complex or harder-to-solve bug, it's ok to merge then follow up with an issue or PR. |
What's the layout bug preventing a demo? |
If you launch the demo in this branch in browsers and navigate to the As far as I understand, the destination view of |
I got that to work after I added this CSS to display: flex;
align-items: center;
justify-content: center; …weirdly, the text isn’t exactly centered. |
These styles worked only in Safari for me and only for height, width always stays 300. I've pushed these changes for the lack of a better option, will have a look later if #241 could resolve it. |
# Conflicts: # Sources/TokamakCore/Views/Buttons/NavigationLink.swift # Sources/TokamakCore/Views/Containers/NavigationView.swift # Sources/TokamakCore/Views/Navigation/NavigationLink.swift # Sources/TokamakCore/Views/Navigation/NavigationView.swift # Sources/TokamakCore/Views/NavigationLink.swift # Sources/TokamakCore/Views/NavigationView.swift # Sources/TokamakStaticHTML/Resources/TokamakStyles.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great!
This is just an empty API at the moment. I hope it can be implemented purely in the
deferredBody
ofGeometryReader
with the ResizeObserver API without requiring any tweaks in theRenderer
protocol or the reconciler.Seems like I need the
domRef
modifier that writesJSObjectRef
to a given binding working first, as discussed in #231.