Skip to content

Commit

Permalink
Merge pull request #218 from SCBJ-7/feature/#217-carousel
Browse files Browse the repository at this point in the history
[#217] carousel 모바일 터치 이벤트 제한
  • Loading branch information
Bumang-Cyber authored Jan 25, 2024
2 parents a5bc1f5 + 95e1335 commit e3b5f17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/homePage/itemCarousel/ItemCarousel.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const CarouselContainer = styled.div<{
overflow: hidden;
cursor: grab;
/* touch-action: pan-y; */
touch-action: pan-y;
`;

export const SliderWrapper = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ const ItemCarouselUnit = ({ item }: UnitProps) => {
navigate(PATH.DETAIL_ROOM(hotel[num].id));
};

//정렬 수정
// 터치 이벤트 제한
return (
<S.LocaleWrapper $display={hotel ? "block" : "none"}>
{hotel[0] && (
<S.ItemUnit onClick={() => onClickHandler(0)}>
<S.ItemUnit
onClick={() => onClickHandler(0)}
onTouchStart={(e) => e.preventDefault()}
>
<img src={hotel[0].imageUrl} onClick={() => onClickHandler(0)} />
<div className="item-info">
<div className="hotel_title">
Expand All @@ -52,7 +55,10 @@ const ItemCarouselUnit = ({ item }: UnitProps) => {
</S.ItemUnit>
)}
{hotel[1] && (
<S.ItemUnit onClick={() => onClickHandler(1)}>
<S.ItemUnit
onClick={() => onClickHandler(1)}
onTouchStart={(e) => e.preventDefault()}
>
<img src={hotel[1].imageUrl} onClick={() => onClickHandler(0)} />
<div className="item-info">
<div className="hotel_title">
Expand Down

0 comments on commit e3b5f17

Please sign in to comment.