Spaces:
Running

axeronis commited on
Commit
e4d1303
·
1 Parent(s): 7b1eec7

fix(mobile): image viewer touch propagation - stop parent from capturing image clicks

Browse files
frontend/components/ChatWindow/MessageBubble.tsx CHANGED
@@ -105,12 +105,20 @@ function MediaContent({ message, isMe, onImageClick }: { message: Message; isMe:
105
  };
106
 
107
  return (
108
- <div className="mt-2">
 
 
 
 
 
109
  <button
110
  type="button"
111
  className="block w-full text-left rounded-xl overflow-hidden cursor-pointer hover:opacity-90 transition-opacity touch-manipulation"
112
  onPointerDown={(e) => e.stopPropagation()}
113
- onTouchEnd={handleOpen}
 
 
 
114
  onClick={handleOpen}
115
  >
116
  <img
 
105
  };
106
 
107
  return (
108
+ <div
109
+ className="mt-2"
110
+ onTouchStart={(e) => e.stopPropagation()}
111
+ onTouchMove={(e) => e.stopPropagation()}
112
+ onTouchEnd={(e) => e.stopPropagation()}
113
+ >
114
  <button
115
  type="button"
116
  className="block w-full text-left rounded-xl overflow-hidden cursor-pointer hover:opacity-90 transition-opacity touch-manipulation"
117
  onPointerDown={(e) => e.stopPropagation()}
118
+ onTouchEnd={(e) => {
119
+ e.stopPropagation();
120
+ handleOpen(e);
121
+ }}
122
  onClick={handleOpen}
123
  >
124
  <img