-
Notifications
You must be signed in to change notification settings - Fork 77
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
Action: text-only actions render off-centered #6879
Comments
+1 - this is pretty noticeable in some interfaces. cc @SkyeSeitz @ashetland |
I think ideally the fix in pr #6562 would only apply to Actions inside an Action Bar. Another possible way to address this might be to have Action Bar account for the space needed by the indicator instead of the Actions themselves. Are vertical Action Bars the only place the indicator space matters? I'd expect horizontal Action Bars could be a little more fluid, like the behavior in Chip Group. |
A considerations/observation is when icon only present, it is positioned absolute. |
Figma file for this issue. Restores Action to previous behavior and requires Action Bar accommodate the needed space for the indicator. |
Accounting for the indicator space at the Action Bar level makes a lot of sense 👍🏽 |
Can we just position the indicator absolutely like we do when there is an icon? This should be a simple fix. I'm not sure how we're expecting the action bar to account for extra space. The width of the action bar is based off of the action content inside. |
WDYT @SkyeSeitz @ashetland - I think positioning this absolutely on any provided icon makes sense. That would still solve the original issue that was fixed that caused this one (expanding action bar with indicator on longest string). For cases that an icon is not provided and the Action is |
Would Action Bar need to expand to accommodate the indicator like it did before in this case? Maybe not the end of the world? |
Yeah, in the case that there are no icons present. But that's a small case and the bump in width is ... less impactful in a negative way... I'd say than the current behavior. The original issue of "action bar with icons becoming wider when indicator is present on longest string" won't occur when icons are used. |
**Related Issue:** #6879 ## Summary Ensures extra space is not added to an action. This is solved by: When an icon is present, the indicator will always be appended to the bottom right. This ensures it remains in the same place whether a parent Action Bar is expanded, or not. The indicator moved a couple of px away - in the future I think we can improve this with a border or clipped ring around the indicator to prevent overlap. Also resolves #5860, for icon-only uses. When an icon is not present, the indicator will be positioned adjacent to the text container. | Before | After | | ------------- | ------------- | | <img width="500" alt="Screenshot 2023-11-15 at 5 00 35 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/ae4d202b-260e-411d-b6fc-30fea2c549ea"> | <img width="500" alt="Screenshot 2023-11-15 at 4 58 47 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/284119d3-e8c4-40e1-8272-7ee204a36539"> | | Before | After | | ------------- | ------------- | | <img width="500" alt="Screenshot 2023-11-15 at 5 00 25 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/fe845c89-abb6-4416-8013-5e105c0b3ebf"> | <img width="500" alt="Screenshot 2023-11-15 at 4 59 26 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/89ef62bf-7a7b-4a1f-ba29-3165df698347"> | (Note, in this one, the "beaker" image is NOT an `icon` property, it is just a slotted element - so the indicator is not positioned over it. This isn't really a documented / expected use case.) | Before | After | | ------------- | ------------- | | <img width="500" alt="Screenshot 2023-11-15 at 5 00 47 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/c8722108-d9df-4540-b268-e7c8e263afdd"> | <img width="500" alt="Screenshot 2023-11-15 at 5 01 02 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/d5a06b63-92bc-4e53-a348-505c9d173188"> | | Before | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 38 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/c3ef3696-71bc-4bde-b066-ea56aebd07bd"> | | ------------- | ------------- | | After | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 57 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/61d91130-a637-4257-84b2-42df18ecb790"> | | Before | <img width="1313" alt="Screenshot 2023-11-15 at 6 21 22 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/26289014-9df0-4e3d-ab2e-491be34cf97b"> | | ------------- | ------------- | | After | <img width="1313" alt="Screenshot 2023-11-15 at 6 18 30 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/d32c2249-86ac-4a4f-9ac8-a7cbde0c322c"> |
**Related Issue:** #6879 ## Summary Ensures extra space is not added to an action. This is solved by: When an icon is present, the indicator will always be appended to the bottom right. This ensures it remains in the same place whether a parent Action Bar is expanded, or not. The indicator moved a couple of px away - in the future I think we can improve this with a border or clipped ring around the indicator to prevent overlap. Also resolves #5860, for icon-only uses. When an icon is not present, the indicator will be positioned adjacent to the text container. | Before | After | | ------------- | ------------- | | <img width="500" alt="Screenshot 2023-11-15 at 5 00 35 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/ae4d202b-260e-411d-b6fc-30fea2c549ea"> | <img width="500" alt="Screenshot 2023-11-15 at 4 58 47 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/284119d3-e8c4-40e1-8272-7ee204a36539"> | | Before | After | | ------------- | ------------- | | <img width="500" alt="Screenshot 2023-11-15 at 5 00 25 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/fe845c89-abb6-4416-8013-5e105c0b3ebf"> | <img width="500" alt="Screenshot 2023-11-15 at 4 59 26 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/89ef62bf-7a7b-4a1f-ba29-3165df698347"> | (Note, in this one, the "beaker" image is NOT an `icon` property, it is just a slotted element - so the indicator is not positioned over it. This isn't really a documented / expected use case.) | Before | After | | ------------- | ------------- | | <img width="500" alt="Screenshot 2023-11-15 at 5 00 47 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/c8722108-d9df-4540-b268-e7c8e263afdd"> | <img width="500" alt="Screenshot 2023-11-15 at 5 01 02 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/d5a06b63-92bc-4e53-a348-505c9d173188"> | | Before | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 38 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/c3ef3696-71bc-4bde-b066-ea56aebd07bd"> | | ------------- | ------------- | | After | <img width="1030" alt="Screenshot 2023-11-15 at 6 17 57 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/61d91130-a637-4257-84b2-42df18ecb790"> | | Before | <img width="1313" alt="Screenshot 2023-11-15 at 6 21 22 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/26289014-9df0-4e3d-ab2e-491be34cf97b"> | | ------------- | ------------- | | After | <img width="1313" alt="Screenshot 2023-11-15 at 6 18 30 PM" src="https://github.com/Esri/calcite-design-system/assets/4733155/d32c2249-86ac-4a4f-9ac8-a7cbde0c322c"> |
Installed and assigned for verification. |
Actual Behavior
There is an extra margin to the right of a calcite action which prevents it from being properly centered in cases where the action is displayed inline with an auto width.
Expected Behavior
Shoudl be able to render an action which is just text where the text is centered in the bounding box of the action.
Reproduction Sample
https://codepen.io/paulcp/pen/zYmzEdQ
Reproduction Steps
Reproduction Version
v1.3.1
Relevant Info
All OS, all browsers.
Caused by #6562 , broken in 1.1.0
Regression?
v1.0.8
Priority impact
p4 - not time sensitive
Impact
We'd like to display a text-only action. We already have these in some interfaces so it will be broken until the upstream calcite issue is fixed.
Esri team
ArcGIS Online
The text was updated successfully, but these errors were encountered: