Skip to content
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

fix: webwallet trpc link for popups #164

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Conversation

bluecco
Copy link
Contributor

@bluecco bluecco commented Dec 19, 2024

Issue / feature description

Quick description of the issue or the feature that is implemented in the pr ie: add new transitions between screens

Changes

quick list regarding the related changes within the pr

ie:

  • add new connector
  • fix injected connector
  • ...

Checklist

  • Rebased to the last commit of the target branch (or merged)
  • Code self-reviewed
  • Code self-tested
  • Tests updated (if needed)
  • All tests are passing locally

Please keep your pull request as small as possible. If you need to make multiple changes, please create separate pull requests for each change. Create a draft pull request if you need early feedback. This will mark the pull request as a work in progress and prevent it from being reviewed or merged until you are ready.

Please move drafts to the ready for review (regular PR) when you are ready to start the review process and other developers will pick it up from there.

@bluecco bluecco marked this pull request as draft December 19, 2024 10:58
Copy link
Member

@Cussone Cussone left a comment

Choose a reason for hiding this comment

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

I don't understand what is different between this and the previous approach, maybe an answer to some of the questions I asked answers that


// Monitor popup state
const checkClosed = setInterval(() => {
if (popup.closed) {
Copy link
Member

Choose a reason for hiding this comment

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

What if popup.closed === true but this.currentPopup !== popup, aka we got another popup 🤔
I'm just thinking of the possible corner case here, not stating that is an issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could be an edge case, but theoretically this.currentPopup !== popup should not happen in this case
popup is always the new one

thinking if this approach could be more reliable but it would requires some tests (using beta branch)

Comment on lines +231 to +235
button.style.position = "fixed"
button.style.top = "-999px"
button.style.left = "-999px"
button.style.opacity = "0"
button.style.pointerEvents = "none" // prevent click event
Copy link
Member

Choose a reason for hiding this comment

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

Are these styles making any difference from the previously used webwalletBtn.style.display = "none"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did some searching and it seems it's more reliable

  • Browser Security: Some browsers treat elements with display: none as "not truly interactive" from a security perspective, which can affect how they handle popup permissions
  • DOM Interaction: While display: none removes the element from the layout flow completely, position: fixed keeps it in the DOM's interactive layer
  • Mobile Browsers: Particularly on mobile browsers, clicks on display: none elements might be ignored or treated differently than clicks on positioned-but-invisible elements

Copy link
Member

Choose a reason for hiding this comment

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

Interesting. I saw something like this coming, legit 👍🏼

@bluecco bluecco changed the base branch from develop to beta-trpc-link December 19, 2024 14:03
@bluecco bluecco marked this pull request as ready for review December 19, 2024 14:04
@bluecco bluecco merged commit 61d6405 into beta-trpc-link Dec 19, 2024
1 check passed
@bluecco bluecco deleted the fix/trpc-link-webwallet branch December 19, 2024 14:04
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.

2 participants