Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
282 stars 76 forks source link

bug: checkbox and buttons cuts outer edge in modal #1379

Closed viCasco closed 1 year ago

viCasco commented 1 year ago

Describe the bug

In the modal component having a checkbox input and receiving the focus cuts off the outer edge and also it in buttons when they occupy the full width of the modal.

image image image

Steps to reproduce Open a modal that contains checkbox and button in full width and on receiving the focus you will see that the outer edge is cut off.

Expected behavior That the checkbox and button elements do not have their outer border cut off when receiving focus in the modal.

Slack https://decathlon-design.slack.com/archives/C01LYRCQ00J/p1677169424235659

thibault-mahe commented 1 year ago

Hi @viCasco , thanks for your message :)

To illustrate what your saying I created a sandbox replicating the issue you're facing: https://codesandbox.io/s/vtmn-react-forked-npgqgv

There is multiple reasons explaining why the focus is cropped here:

Unfortunately, I would say that this is not a bug, it is a combination of features on which we can't do much...

The best solution would be to add a small space (padding) in the body of the modal to leave enough room for the outline of the focus elements to be visible. See the second modal here: https://codesandbox.io/s/vtmn-react-forked-npgqgv

I remain available if I misunterstood your issue or if you have any question. If this answer is Ok for you i'll close this issue.

Thanks!