Skip to content

fix(popupreply): Move PopupReply into new PopupManager layer#603

Merged
ConradJChan merged 4 commits intobox:masterfrom
ConradJChan:move-popupreply
Sep 25, 2020
Merged

fix(popupreply): Move PopupReply into new PopupManager layer#603
ConradJChan merged 4 commits intobox:masterfrom
ConradJChan:move-popupreply

Conversation

@ConradJChan
Copy link
Contributor

@ConradJChan ConradJChan commented Sep 24, 2020

Issue
With the way that PopupReply was rendered in the same layer as the annotation-specific layer (region, highlight), the popup in some browsers (ie11) would be beneath other drawn annotation elements, depending on what order the annotation layers were configured.

Overview
Creates a new PopupManager that renders the PopupReply for the staged annotation, regardless of annotation type so that it can always be the top layer.

Before
Screen Shot 2020-09-24 at 11 24 30 AM

After
Screen Shot 2020-09-24 at 11 25 43 AM

TODO

  • unit tests
  • cross-browser testing

@ChenCodes
Copy link
Contributor

Could you add a gif of the experience?

@ConradJChan
Copy link
Contributor Author

@ChenCodes Updated with screenshots -- before the highlight would appear above the create region PopupReply

@ConradJChan ConradJChan marked this pull request as ready for review September 25, 2020 06:50
@ConradJChan ConradJChan requested a review from a team as a code owner September 25, 2020 06:50
jstoffan
jstoffan previously approved these changes Sep 25, 2020
status,
} = props;

const [reference, setReference] = React.useState<PopupReference | null>(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the extra state here needed or can we derive and pass the virtualElement directly in render?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had originally done just that, but I think the fact that virtualElement was a new object each render caused some wonky behavior in IE11

@ConradJChan ConradJChan merged commit 181e049 into box:master Sep 25, 2020
@ConradJChan ConradJChan deleted the move-popupreply branch September 25, 2020 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants