fix(Tabs): guard crypto.randomUUID() to prevent render crash in non-secure contexts - #3792
Merged
Merged
Conversation
…ecure contexts Tabs.svelte was the only component in blade-svelte calling crypto.randomUUID() without a fallback guard. When crypto.randomUUID is unavailable (non-secure context), the Tabs component throws during initialization, preventing all TabItem elements from rendering — causing the BrowserStack Desktop test to fail with 'element(s) not found' for [data-blade-tab-value]. This adds the same defensive guard pattern already used by SegmentedControl, BottomSheet, and Toast. Also adds toBeVisible() wait in the test to match the pattern used in segmentedControl.spec.ts. Co-authored-by: admin <admin>
Contributor
|
🤖 Slash AI Review has been triggered. View execution logs |
Collaborator
🛡️ Coverage ReportSummaryFull Coverage Details |
Contributor
Author
There was a problem hiding this comment.
✨ Agentic PR Review ✨
Status: Approved ✅
UI Review
✅ 5 passed
Passing checks (5)
| Check | Screenshot |
|---|---|
| ✅ Tabs Default story | ![]() |
| ✅ Tabs Default - tab switching interaction | ![]() |
| ✅ Tabs Size: Small story | ![]() |
| ✅ Tabs FilledVertical story | ![]() |
| ✅ Tabs Showcase story | ![]() |
Usage
import { Tabs, TabItem, TabPanels, TabPanel } from '@razorpay/blade/svelte/components';
<Tabs>
<TabItem value="1">Tab 1</TabItem>
<TabItem value="2">Tab 2</TabItem>
<TabPanels>
<TabPanel value="1">Content 1</TabPanel>
<TabPanel value="2">Content 2</TabPanel>
</TabPanels>
</Tabs>
saurabhdaware
marked this pull request as ready for review
July 22, 2026 05:42
saurabhdaware
enabled auto-merge (squash)
July 22, 2026 05:42
saurabhdaware
approved these changes
Jul 22, 2026
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.






Problem
The BrowserStack Desktop Chrome test for Tabs was failing with
element(s) not foundfor the[data-blade-tab-value]selector (73 passed, 1 failed).Failing run: https://github.com/razorpay/blade/actions/runs/29836878552
Root Cause
Tabs.sveltewas the only component in blade-svelte callingcrypto.randomUUID()without a fallback guard. Whencrypto.randomUUIDis unavailable (non-secure context), the Tabs component throws aTypeErrorduring initialization, preventing allTabItemelements from rendering.Every other component already has a defensive guard:
SegmentedControl.svelteBottomSheet.sveltetoastStore.tsFix
Tabs.svelte— Add the same guard pattern used by SegmentedControl with Math.random fallbacktabs.spec.ts— AddtoBeVisible()wait before attribute assertions (matchingsegmentedControl.spec.ts)🤖 Automated changes by autonomous agent.
Requested by: admin