Skip to content

Commit

Permalink
refactor: (#19) 변수명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
inyeong-kang committed Jul 12, 2023
1 parent 8141768 commit d4bac71
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export default function TimePickerOption({
useEffect(() => {
const handleScroll = () => {
const timeBox = timeBoxRef.current;

// clientHeight는 항상 100px로 고정되어 있음 (TimeBox의 높이가 100px 이기 때문)
if (timeBox) {
const centerHourIndex = Math.floor((timeBox.scrollTop + timeBox.clientHeight / 2) / 50);
const pickedTimeIndex = Math.floor((timeBox.scrollTop + timeBox.clientHeight / 2) / 50);

if (centerHourIndex >= 0 && centerHourIndex < timeBox.children.length) {
handlePickTime(centerHourIndex);
if (pickedTimeIndex >= 0 && pickedTimeIndex < timeBox.children.length) {
handlePickTime(pickedTimeIndex);
}
}
};
Expand Down

0 comments on commit d4bac71

Please sign in to comment.