Skip to content

Make z-index of Select very very high - #73

Merged
lukaw3d merged 1 commit into
masterfrom
lw/select-zindex
Oct 8, 2025
Merged

Make z-index of Select very very high#73
lukaw3d merged 1 commit into
masterfrom
lw/select-zindex

Conversation

@lukaw3d

@lukaw3d lukaw3d commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

I think radix primitive inside Select always calculates available height as whole screen. So it might place items underneath other z-index elements and make them unreachable. In explorer can not select Transfer method:
https://explorer.dev.oasis.io/testnet/sapphire/address/oasis1qzd4lct2jgtnaysz22g2ujgww63y6dsc5vxjdk4w?tx_method=
image

This high z-index might cause other issues: do shadcn alerts expect to be displayed over select when they make everything unclickable? 🤷

@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

Deployed to Cloudflare Pages

Latest commit: d9c39e0cdd41b9322445f3c0e90b216993d184fa
Status:✅ Deploy successful!
Preview URL: https://5fba26d3.oasis-ui.pages.dev
Alias: https://pr-73.oasis-ui.pages.dev

@lukaw3d

lukaw3d commented Oct 1, 2025

Copy link
Copy Markdown
Contributor Author

hm, this official shadcn example appears to use sticky header with default z-index https://ui.shadcn.com/view/sidebar-02 so maybe we should change explorer instead

@lukaw3d

lukaw3d commented Oct 1, 2025

Copy link
Copy Markdown
Contributor Author

default z-index for sticky header sounds very error prone tho

Comment thread src/components/ui/select.tsx Outdated
data-slot="select-content"
className={cn(
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-99999999999 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',

@buberdds buberdds Oct 2, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • this is misleading as value used in a browser will be different. There is no such class in Tailwind so this will end up with -> Tailwind's JIT -> exceeds JavaScript's safe integer range
  • can we use z-[9999] (in general arbitrary values are in square brackets in tailwind)
  • optional: ui folder was auto-generated. there is customize select in components/select folder where we override "base" select

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

+1

I don't know how to differentiate arbitrary value vs tailwind pre-generated values. https://tailwindcss.com/docs/z-index doesnt say

I think radix primitive inside Select always calculates available height as
whole screen. So it might place items underneath other z-index elements and make
them unreachable. In explorer could not select Transfer method under topbar.
@lukaw3d
lukaw3d requested a review from buberdds October 8, 2025 11:07
@lukaw3d
lukaw3d merged commit d0109b7 into master Oct 8, 2025
4 checks passed
@lukaw3d
lukaw3d deleted the lw/select-zindex branch October 8, 2025 18:21
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