인풋박스 선택 시 스크롤이 상단으로 이동하는 버그
CSS로 라디오 버튼을 숨긴 경우에 주로 발생
라디오 버튼 숨김 CSS
.radio_box input {
position: absolute;
top: -9999px;
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
opacity: 0;
clip-path: polygon(0 0, 0 0, 0 0)
}
.radio_box input {
position: absolute;
top: -9999px;
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
opacity: 0;
clip-path: polygon(0 0, 0 0, 0 0)
}
// 해결방법들
// 라디오버튼 일 경우
input[type="radio"] {
display: none
}
// 체크박스 일 경우
input[type="checkbox"] {
display: none
}
// visibility: hidden; 추가
// top 값을 할당하지 않거나 'auto'
.hiddenInput {
opacity: 0;
height: 0;
width: 0;
margin: 0;
padding: 0;
position: fixed;
top: 0;
}