Bug: Toggle Docs Menu Icon not visible in dark mode and by default template responsive device options not visible even if current tab is preview
rameshmane7218 opened this issue · 1 comments
rameshmane7218 commented
-
Toggle Docs Menu Icon not visible in dark mode :-
- IconButton has bg='white' and based on
currentColor
icons color will change. - So, on dark theme currentColor is white and IconButton bg also white
- IconButton has bg='white' and based on
-
By default template responsive device options not visible
It is visible only after switching tab from
Code
to againPreview
<ExampleViewerRadio isOpen={tabIndex === 0 && IsNotSmartPhoneWidth}>
<HStack>
{options.map((value) => {
const label = value.width
const radio = getRadioProps({ value: label })
return (
<RadioCard key={value.label} {...radio}>
{value.icon}
</RadioCard>
)
})}
</HStack>
</ExampleViewerRadio>
- As per above code options are visible if (tabIndex === 0 && IsNotSmartPhoneWidth) == true
- Everything in code is correct but the issue is with animation
const variants = {
open: {
opacity: 1,
y: 0,
display: 'block',
},
closed: {
opacity: 0,
y: 20,
transitionEnd: {
display: 'none',
},
},
}
const ExampleViewerRadio: React.VFC<Props> = (props) => {
return (
<MotionBox
as="aside"
initial={{ scale: 1 }}
transition={{ duration: 0.15, type: 'tween' }}
animate={props.isOpen ? 'open' : 'closed'}
variants={variants}>
{props.children}
</MotionBox>
)
}
- Initialy (
const IsNotSmartPhoneWidth = useBreakpointValue([false, true])
) IsNotSmartPhoneWidth value is false and after some time its true due to thatisOpen
props ofExampleViewerRadio
is changing before completing firstclosed
animation - Here initially (before user interaction) the animation start and complete sequence is
- Start
closed
animation - Start
open
animation (this will set display: 'block') - TransitionEnd
closed
animation (this will set display: 'none')
- Start
- To fix this we need to add
transitionEnd: {display: 'block'}
inopen
animation variants - I also tried different approch like manually controlling animation using
useAnimate()
which allow us control animation manually set, start and stop but this is also not working
rameshmane7218 commented
Please assign this issue to me as I already fixed this locally and also adding 1 new curved carousel