theme-ui icon indicating copy to clipboard operation
theme-ui copied to clipboard

Radio forces iframe to scroll in a wrong way

Open AlexisLeite opened this issue 4 years ago • 4 comments

As the title says, the radio button in a particular situation, forces the browser to scroll in a bad manner.

To Reproduce

  • Please, visit: https://codesandbox.io/s/clever-tamas-2wszu6?file=/src/App.js:37-43
  • Focus the input at the beginnig of the document.
  • Press tab until the scroll gets broken

AlexisLeite avatar May 19 '22 20:05 AlexisLeite

Hey! I'm trying this out but I don't see any scrolling that's broken—I wouldn't recommend scrollable fixed-position elements in general, but pressing tab through the focusable elements, the frame scrolls just fine for me. Can you be more specific about the behavior you're expecting vs seeing here?

lachlanjc avatar May 23 '22 14:05 lachlanjc

I dont know why it didn't fail to you, we tried it with my mates and it failed to us all. Here you have an attached video to see what happens to me

https://vimeo.com/712960511

AlexisLeite avatar May 23 '22 17:05 AlexisLeite

Can you remove overflow: hidden from the top level box? It solves the problem.

https://codesandbox.io/s/sad-lichterman-cenwbv?file=/src/App.js

If you have bandwith, we'd love a deeper insight into why does this fail in your use case. Is the visually hidden input the culprit? Can this behaviour be observed with other styled radio inputs?

hasparus avatar May 23 '22 19:05 hasparus

Hi, sorry for the delay.

I've solved the problem with this css code:

input[type="radio"], input[type="checkbox"] { position: relative !important; float: right; }

Greetings

AlexisLeite avatar May 30 '22 14:05 AlexisLeite