Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Git clone
- node설치
- fontawesome
- npm install
- npm start
- git lab clone
- 글자들여쓰기
- package.json
- node 오류
- 플러그인
- legacy-peer
- minwidth
- 의존성문제
- googleicon
- owlcarousel
- 웹아이콘
- MediaQuery
- XEIcon
- 아이콘사용법
- 동적객체
- vscode git clone
- npm install 문제
- react npm install
- 정적객체
- maxwidth
- window 정책변경
- slickslider
- 그누보드반응형
- 이미지반응형
- 단어단위로떨어지기
Archives
- Today
- Total
어쩌다 알게 된 ƪ(•̃͡•̃͡ ƪ
ReactSortable 안에 버튼 안눌리는 이슈 (안드로이드만) 본문
728x90
const handleTouchStart = (e) => {
const touch = e.touches[0];
e.target.startX = touch.clientX;
e.target.startY = touch.clientY;
};
const handleTouchEnd = (e, callback) => {
const touch = e.changedTouches[0];
const dx = Math.abs(touch.clientX - e.target.startX);
const dy = Math.abs(touch.clientY - e.target.startY);
// 터치 이동이 거의 없으면 클릭 처리
if (dx < 5 && dy < 5) {
callback();
}
};
return(
<button
onTouchStart={handleTouchStart}
onTouchEnd={(e) => handleTouchEnd(e, 드래그가 아닐 시 실행할 함수내용)}
>
삭제
</button>
)
728x90
Comments