-
Notifications
You must be signed in to change notification settings - Fork 147
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: SpotlightPopoverTour bugs #1826
Changes from all commits
b04f5da
c1abd1e
95f20ce
5dd06f4
405c6f6
fc89e7b
2a8e264
5b4652a
0b97d3f
6663e5e
4340512
65ae1ec
ff2b4c0
24ea008
3456fc3
5134e88
1b648c7
3522f22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@razorpay/blade": patch | ||
--- | ||
|
||
fix(blade): fixed SpotlightPopoverTour bugs | ||
|
||
- Safari body-scroll-lock causing the page to get clipped because storybook doesn't set width/height on body - fixed by setting width/height | ||
- Initial delay of opening the mask - fixed by immediately updating the mask size on initial render | ||
- Delay of transitioning between steps which occurs because we need to wait for the animation to finish before scrolling otherwise the scroll gets interrupted - fixed by reduced this to 100ms |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,20 @@ function AppWrapper(): JSX.Element { | |
export default AppWrapper; | ||
``` | ||
|
||
## iOS Safari Specific Setup | ||
|
||
When using BottomSheet or SpotlightPopoverTour, | ||
Make sure to set a width/height to the `body` otherwise when they open, the page will get clipped. | ||
|
||
This happens due to a bug in iOS safari where it won't compute the height of the body correctly. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any link to this issue that we can add here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I observed this weird bug on computed properties of safari dev tools, but don't have exact webkit bug reference. There are multiple issues with safari's height calculations: https://developer.apple.com/forums/thread/128949 |
||
|
||
```css | ||
body { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
``` | ||
|
||
## Mapping Components from Figma to Blade in your code | ||
|
||
Blade is built with **"What you see in Figma is what you get on Code" ** philosophy. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ import { Link } from '~components/Link'; | |
import { Sandbox } from '~utils/storybook/Sandbox'; | ||
import StoryPageWrapper from '~utils/storybook/StoryPageWrapper'; | ||
import { isReactNative } from '~utils'; | ||
import { SandboxHighlighter } from '~utils/storybook/Sandbox/SandpackEditor'; | ||
|
||
const Page = (): React.ReactElement => { | ||
return ( | ||
|
@@ -134,6 +135,20 @@ const Page = (): React.ReactElement => { | |
export default App; | ||
`} | ||
</Sandbox> | ||
<Title>iOS Safari Specific Setup</Title> | ||
<Text marginTop="spacing.4"> | ||
When using BottomSheet or SpotlightPopoverTour, Make sure to set a width/height to the | ||
`body` otherwise when they open, the page will get clipped. This happens due to a bug in iOS | ||
safari where it won't compute the height of the body correctly. | ||
</Text> | ||
<SandboxHighlighter showLineNumbers={false} theme="light"> | ||
{` | ||
body { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
`} | ||
Comment on lines
+145
to
+150
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This won't get highlighted since in SandboxHighlighter I had kept |
||
</SandboxHighlighter> | ||
</StoryPageWrapper> | ||
); | ||
}; | ||
|
@@ -225,6 +240,51 @@ const BottomSheetTemplate: ComponentStory<typeof BottomSheetComponent> = ({ ...a | |
return ( | ||
<BaseBox> | ||
<Button onClick={() => setIsOpen(true)}>{isOpen ? 'close' : 'open'}</Button> | ||
<Text marginY="spacing.11"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has | ||
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a | ||
galley of type and scrambled it to make a type specimen book. It has survived not only five | ||
centuries, but also the leap into electronic typesetting, remaining essentially unchanged. | ||
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum | ||
passages, and more recently with desktop publishing software like Aldus PageMaker including | ||
versions of Lorem Ipsum. | ||
</Text> | ||
<Text marginY="spacing.11"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has | ||
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a | ||
galley of type and scrambled it to make a type specimen book. It has survived not only five | ||
centuries, but also the leap into electronic typesetting, remaining essentially unchanged. | ||
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum | ||
passages, and more recently with desktop publishing software like Aldus PageMaker including | ||
versions of Lorem Ipsum. | ||
</Text> | ||
<Text marginY="spacing.11"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has | ||
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a | ||
galley of type and scrambled it to make a type specimen book. It has survived not only five | ||
centuries, but also the leap into electronic typesetting, remaining essentially unchanged. | ||
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum | ||
passages, and more recently with desktop publishing software like Aldus PageMaker including | ||
versions of Lorem Ipsum. | ||
</Text> | ||
<Text marginY="spacing.11"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has | ||
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a | ||
galley of type and scrambled it to make a type specimen book. It has survived not only five | ||
centuries, but also the leap into electronic typesetting, remaining essentially unchanged. | ||
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum | ||
passages, and more recently with desktop publishing software like Aldus PageMaker including | ||
versions of Lorem Ipsum. | ||
</Text> | ||
<Text marginY="spacing.11"> | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has | ||
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a | ||
galley of type and scrambled it to make a type specimen book. It has survived not only five | ||
centuries, but also the leap into electronic typesetting, remaining essentially unchanged. | ||
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum | ||
passages, and more recently with desktop publishing software like Aldus PageMaker including | ||
versions of Lorem Ipsum. | ||
</Text> | ||
<BottomSheetComponent | ||
{...args} | ||
isOpen={isOpen} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Meta } from '@storybook/addon-docs'; | ||
import { TourDocs } from './TourDocs.stories'; | ||
|
||
<Meta title="Components/SpotlightPopoverTour/Docs" /> | ||
|
||
<TourDocs /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add this to Bottmsheet and Popover's docs as well in on top of the page something that is highlighted?