Skip to content

Conversation

@adlius
Copy link
Contributor

@adlius adlius commented Mar 10, 2021

Purpose

There is some weird interaction between the text-align: center on the parent fieldset element and the position: absolute of the child input element in Webkit. This could be a potential Webkit bug and I have tried to narrow down to a very specific scenario, as shown in this jsfiddle.
In the jsfiddle demo, it seems that the bug appears when the parent block element with text-align: center has both child block elements and child inline elements. In this scenario, the child inline elements with position: absolute would not be centered correctly.
This fix bypass this potential bug by wrapping <label> and <input> in a div, because in this case the position: absolute of the <input> would be relative to the wrapping <div> instead of to the <fieldset>.
Tested on WebkitGTK, Chrome and Firefox and it all works. Haven't tried Edge yet but I don't expect it to be any different from Chrome because it it based on Chromium.
Possible related bug report for webkit: https://bugs.webkit.org/show_bug.cgi?id=31241

Summary of Changes

Side Effects

QA Notes

@adlius adlius changed the title Fix radio button positioning in webkit [ENG-2641] Fix radio button positioning in webkit Mar 10, 2021
@futa-ikeda futa-ikeda merged commit 1e8ff39 into CenterForOpenScience:develop Mar 10, 2021
@fabmiz fabmiz added this to the 21.1.0 milestone Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants