Open prabirshrestha opened 1 year ago
This is controlled by the css, which currently has no concept of hidden/visible text; it only knows if there is a node. https://github.com/adobe/react-spectrum/blob/8987f9283871b1bda0acc4637096966275f82167/packages/%40adobe/spectrum-css-temp/components/button/index.css#L147
We might be able to add some :not([hidden])
.
Your "workaround" is how I would recommend solving the issue, though, without that extra css. I don't really feel like it's a hack; that is what the hook is there for, to solve odd cases like this. We have only removed/added the label in cases where the container is a certain size compared to the button, so we've never run across this use case.
You could submit a PR adding the appropriate CSS selectors to the existing rules if you'd like.
Provide a general summary of the issue here
For responsive design I would like to remove
<Text>
when in mobile view but show it when in larger screens.๐ค Expected Behavior?
Correct alignment.
๐ฏ Current Behavior
left padding is bigger than the right instead of center aligned.
๐ Possible Solution
isHidden
should be respected for now I'm using the following workaround.Seems like a hack.
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
Set isHidden for ActionButton and resize the window.
Version
3.29.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
linux
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response