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 issue with Link Overlay in tBTC Explorer #556

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

michalsmiarowski
Copy link
Contributor

@michalsmiarowski michalsmiarowski commented Jun 26, 2023

We encountered an issue with the component from chakra-ui while using it in the History table on the tBTC Explorer page. This component was intended to facilitate navigation for each row, directing the user to the corresponding etherscan link. However, we noticed an abnormal behavior specifically on real mobile devices, even though it worked correctly in the mobile view on Chrome.

On mobile, the overlay for the last item appeared to cover the entire page. As a result, any other links on the tBTC Explorer page, such as "View on Dune Analytics" or "Start Minting," unintentionally redirected the user to etherscan.

The cause of this was that the LinkBox component uses position: relative to contain the absolute positioned LinkOverlay. Unfortunately <Tr /> component, which we passed to the as property, does not allow position: relative`.

As a hacky workaround we are applying transform: scale(1) to the tr element. See chakra-ui/chakra-ui#3832 for more info.

To test it out run yarn start as usual and then go to the link from On Your Network: on your mobile device. I've tested it out using Chrome nad Safari on iPhone and it seems to work as expected now.

We encountered an issue with the <LinkOverlay> component from chakra-ui while
using it in the History table on the tBTC Explorer page. This component was
intended to facilitate navigation for each row, directing the user to the
corresponding etherscan link. However, we noticed an abnormal behavior
specifically on real mobile devices, even though it worked correctly in the
mobile view on Chrome.

On mobile, the overlay for the last item appeared to cover the entire page. As a
result, any other links on the tBTC Explorer page, such as "View on Dune
Analytics" or "Start Minting," unintentionally redirected the user to etherscan.

The cause of this was that the `LinkBox` component uses `position: relative` to
contain the absolute positioned `LinkOverlay`.  Unfortunately `<Tr />`
component, which we passed to the `as property, does not allow `position:
relative`.

As a hacky workaround we are applying `transform: scale(1)` to the tr element.
@github-actions
Copy link

Copy link
Collaborator

@r-czajkowski r-czajkowski left a comment

Choose a reason for hiding this comment

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

Looks like it fixes an issue with links but now I can't scroll the table horizontally on mobile on FF and Safari.

@michalsmiarowski
Copy link
Contributor Author

michalsmiarowski commented Jun 30, 2023

Looks like it fixes an issue with links but now I can't scroll the table horizontally on mobile on FF and Safari.

Hmmm, I've tested on Chrome and Safari using preview link and it works ok.

Chrome version: 114.0.5735.124 (You can check your by going into Chrome -> click three dots (...) in right-bottom corner -> Settings (in the top bar) -> Google Chrom)

Safari version: Probably 16.3 (Not sure how to check it, but I've for iOS 16.3.1 and it based on my really quick research if has Safari 16.3)

Here are videos showing that it works for me:

safari_scroll.MP4
chrome_scroll.MP4

Do you mind checking it again @r-czajkowski? And also let me know what versions of the browser did you use

@r-czajkowski
Copy link
Collaborator

Looks like it fixes an issue with links but now I can't scroll the table horizontally on mobile on FF and Safari.

Hmmm, I've tested on Chrome and Safari using preview link and it works ok.

Chrome version: 114.0.5735.124 (You can check your by going into Chrome -> click three dots (...) in right-bottom corner -> Settings (in the top bar) -> Google Chrom)

Safari version: Probably 16.3 (Not sure how to check it, but I've for iOS 16.3.1 and it based on my really quick research if has Safari 16.3)

Here are videos showing that it works for me:
safari_scroll.MP4
chrome_scroll.MP4

Do you mind checking it again @r-czajkowski? And also let me know what versions of the browser did you use

It doesn't work on mobile on Safari 15.5 and Firefox 113.0 (30633)

@michalsmiarowski
Copy link
Contributor Author

@r-czajkowski Checked on firefox and it also works for me 🤔 Firefox version 115.1 (32781). Can you update firefox and safari and check again using preview link?

firefox_scroll.MOV

@r-czajkowski r-czajkowski merged commit 558db5b into main Jul 25, 2023
5 checks passed
@r-czajkowski r-czajkowski deleted the fix-issue-with-link-overlay-in-tbtc-explorer branch July 25, 2023 20:08
@michalsmiarowski michalsmiarowski modified the milestones: v1.9.0, v1.10.0 Jul 25, 2023
@r-czajkowski r-czajkowski modified the milestones: v1.10.0, v1.9.1 Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants