Add presize API to <perspective-viewer>#3144
Merged
Conversation
8774e25 to
2a244f8
Compare
Signed-off-by: Andrew Stein <steinlink@gmail.com>
2a244f8 to
ed53227
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an API which allows
resize()to use a size hint to draw itself (potentially slow and async) with new dimensions, avoiding screen tearing/thrashing when a<perspective-viewer>is about to be moved/resized externally via CSS or layout changes.resize()method now accepts an optional{dimensions: {width, height}}object, allowing callers to provide explicit size hints for the plugin container. This does not set the dimensions of the element towidth,height; rather, it draws the plugin at these dimensions (including event-loop-boundary crossing async calls if the plugin must fetch) disregarding over/underflow of the<perspective-viewer>component itself, which presumably will be updated to these dimensions synchronously immediately by the caller whenresize()resolves. The oldforceboolean parameter is removed.Ancillary, the copy, export, column, filter, and function dropdown menus were previously implemented as standalone custom elements that created their own Shadow DOM hosts. They are now rendered inline as Yew components using a new
PortalModalcomponent that portals content todocument.bodywith proper positioning and focus management. This removes ~500 lines of custom element boilerplate and deletes 4 files.No tests were harmed in the making of this PR.