Skip to content
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

Alignment for ProductSwitch and ProductSwitchItem #6594

Closed
MetalCar opened this issue Feb 27, 2023 · 6 comments · Fixed by #6683
Closed

Alignment for ProductSwitch and ProductSwitchItem #6594

MetalCar opened this issue Feb 27, 2023 · 6 comments · Fixed by #6683

Comments

@MetalCar
Copy link

Is your feature request related to a problem?

I want to set the alignment for ProductSwitchItems in a ProductSwitch. Currently all ProductSwitchItems are left-aligned within the ProductSwitch-Container. Unfortunately there's no way to override this behaviour.

Describe the solution you'd like

So it would be nice to set the alignment with a property alignment="left|center|right" or something else.

Describe alternatives you've considered

No response

Additional Context

No response

@Lukas742
Copy link
Collaborator

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

@Lukas742 Lukas742 transferred this issue from SAP/ui5-webcomponents-react Feb 27, 2023
@NHristov-sap
Copy link
Contributor

Hello @SAP/ui5-webcomponents-topic-p,

Please take a look of this feature request.

Best Regards,
Nikolay Hristov

@dobrinyonkov dobrinyonkov self-assigned this Mar 9, 2023
@dobrinyonkov
Copy link
Contributor

Hello @MetalCar,

Thanks for reporting this.
Alignment can already be achived by styling the custom element directly.
See: https://codesandbox.io/s/ui5-webcomponents-forked-p6lc7l?file=/index.html

Please try it and let us know if you face any other issues.

Kind Regards,
Dobrin

@MetalCar
Copy link
Author

MetalCar commented Mar 9, 2023

Hello @dobrinyonkov
thanks for your codesandbox link - but unfortunately this isn't what I want to do. It seems like you tricked yourself with adding at least three items in a row.

Please see my example:
https://codesandbox.io/s/ui5-webcomponents-forked-ub0y5h

I have two product-switch-items and i want to center them. As you can see in my example, they are aligned left.

@dobrinyonkov
Copy link
Contributor

Hi @MetalCar with #6683 now merged you should be able to use the justify-content property on the custom element which will be inherited by the root element inside the shadow dom.

@MetalCar
Copy link
Author

MetalCar commented Mar 10, 2023

Hi @dobrinyonkov . Thank you for your quick response - i will try this on monday at work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

4 participants