react-resizable-panels 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.11
4
+
5
+ - Fix resize handle cursor hit detection when when viewport is scrolled (#305)
6
+
3
7
  ## 2.0.10
4
8
 
5
9
  - Fix conditional layout edge case (#309)
@@ -271,15 +271,15 @@ function isTouchEvent(event) {
271
271
  function getResizeEventCoordinates(event) {
272
272
  if (isMouseEvent(event)) {
273
273
  return {
274
- x: event.pageX,
275
- y: event.pageY
274
+ x: event.clientX,
275
+ y: event.clientY
276
276
  };
277
277
  } else if (isTouchEvent(event)) {
278
278
  const touch = event.touches[0];
279
- if (touch && touch.pageX && touch.pageY) {
279
+ if (touch && touch.clientX && touch.clientY) {
280
280
  return {
281
- x: touch.pageX,
282
- y: touch.pageY
281
+ x: touch.clientX,
282
+ y: touch.clientY
283
283
  };
284
284
  }
285
285
  }
@@ -277,15 +277,15 @@ function isTouchEvent(event) {
277
277
  function getResizeEventCoordinates(event) {
278
278
  if (isMouseEvent(event)) {
279
279
  return {
280
- x: event.pageX,
281
- y: event.pageY
280
+ x: event.clientX,
281
+ y: event.clientY
282
282
  };
283
283
  } else if (isTouchEvent(event)) {
284
284
  const touch = event.touches[0];
285
- if (touch && touch.pageX && touch.pageY) {
285
+ if (touch && touch.clientX && touch.clientY) {
286
286
  return {
287
- x: touch.pageX,
288
- y: touch.pageY
287
+ x: touch.clientX,
288
+ y: touch.clientY
289
289
  };
290
290
  }
291
291
  }
@@ -253,15 +253,15 @@ function isTouchEvent(event) {
253
253
  function getResizeEventCoordinates(event) {
254
254
  if (isMouseEvent(event)) {
255
255
  return {
256
- x: event.pageX,
257
- y: event.pageY
256
+ x: event.clientX,
257
+ y: event.clientY
258
258
  };
259
259
  } else if (isTouchEvent(event)) {
260
260
  const touch = event.touches[0];
261
- if (touch && touch.pageX && touch.pageY) {
261
+ if (touch && touch.clientX && touch.clientY) {
262
262
  return {
263
- x: touch.pageX,
264
- y: touch.pageY
263
+ x: touch.clientX,
264
+ y: touch.clientY
265
265
  };
266
266
  }
267
267
  }
@@ -247,15 +247,15 @@ function isTouchEvent(event) {
247
247
  function getResizeEventCoordinates(event) {
248
248
  if (isMouseEvent(event)) {
249
249
  return {
250
- x: event.pageX,
251
- y: event.pageY
250
+ x: event.clientX,
251
+ y: event.clientY
252
252
  };
253
253
  } else if (isTouchEvent(event)) {
254
254
  const touch = event.touches[0];
255
- if (touch && touch.pageX && touch.pageY) {
255
+ if (touch && touch.clientX && touch.clientY) {
256
256
  return {
257
- x: touch.pageX,
258
- y: touch.pageY
257
+ x: touch.clientX,
258
+ y: touch.clientY
259
259
  };
260
260
  }
261
261
  }
@@ -273,15 +273,15 @@ function isTouchEvent(event) {
273
273
  function getResizeEventCoordinates(event) {
274
274
  if (isMouseEvent(event)) {
275
275
  return {
276
- x: event.pageX,
277
- y: event.pageY
276
+ x: event.clientX,
277
+ y: event.clientY
278
278
  };
279
279
  } else if (isTouchEvent(event)) {
280
280
  const touch = event.touches[0];
281
- if (touch && touch.pageX && touch.pageY) {
281
+ if (touch && touch.clientX && touch.clientY) {
282
282
  return {
283
- x: touch.pageX,
284
- y: touch.pageY
283
+ x: touch.clientX,
284
+ y: touch.clientY
285
285
  };
286
286
  }
287
287
  }
@@ -284,15 +284,15 @@ function isTouchEvent(event) {
284
284
  function getResizeEventCoordinates(event) {
285
285
  if (isMouseEvent(event)) {
286
286
  return {
287
- x: event.pageX,
288
- y: event.pageY
287
+ x: event.clientX,
288
+ y: event.clientY
289
289
  };
290
290
  } else if (isTouchEvent(event)) {
291
291
  const touch = event.touches[0];
292
- if (touch && touch.pageX && touch.pageY) {
292
+ if (touch && touch.clientX && touch.clientY) {
293
293
  return {
294
- x: touch.pageX,
295
- y: touch.pageY
294
+ x: touch.clientX,
295
+ y: touch.clientY
296
296
  };
297
297
  }
298
298
  }
@@ -260,15 +260,15 @@ function isTouchEvent(event) {
260
260
  function getResizeEventCoordinates(event) {
261
261
  if (isMouseEvent(event)) {
262
262
  return {
263
- x: event.pageX,
264
- y: event.pageY
263
+ x: event.clientX,
264
+ y: event.clientY
265
265
  };
266
266
  } else if (isTouchEvent(event)) {
267
267
  const touch = event.touches[0];
268
- if (touch && touch.pageX && touch.pageY) {
268
+ if (touch && touch.clientX && touch.clientY) {
269
269
  return {
270
- x: touch.pageX,
271
- y: touch.pageY
270
+ x: touch.clientX,
271
+ y: touch.clientY
272
272
  };
273
273
  }
274
274
  }
@@ -246,15 +246,15 @@ function isTouchEvent(event) {
246
246
  function getResizeEventCoordinates(event) {
247
247
  if (isMouseEvent(event)) {
248
248
  return {
249
- x: event.pageX,
250
- y: event.pageY
249
+ x: event.clientX,
250
+ y: event.clientY
251
251
  };
252
252
  } else if (isTouchEvent(event)) {
253
253
  const touch = event.touches[0];
254
- if (touch && touch.pageX && touch.pageY) {
254
+ if (touch && touch.clientX && touch.clientY) {
255
255
  return {
256
- x: touch.pageX,
257
- y: touch.pageY
256
+ x: touch.clientX,
257
+ y: touch.clientY
258
258
  };
259
259
  }
260
260
  }
@@ -222,15 +222,15 @@ function isTouchEvent(event) {
222
222
  function getResizeEventCoordinates(event) {
223
223
  if (isMouseEvent(event)) {
224
224
  return {
225
- x: event.pageX,
226
- y: event.pageY
225
+ x: event.clientX,
226
+ y: event.clientY
227
227
  };
228
228
  } else if (isTouchEvent(event)) {
229
229
  const touch = event.touches[0];
230
- if (touch && touch.pageX && touch.pageY) {
230
+ if (touch && touch.clientX && touch.clientY) {
231
231
  return {
232
- x: touch.pageX,
233
- y: touch.pageY
232
+ x: touch.clientX,
233
+ y: touch.clientY
234
234
  };
235
235
  }
236
236
  }
@@ -249,15 +249,15 @@ function isTouchEvent(event) {
249
249
  function getResizeEventCoordinates(event) {
250
250
  if (isMouseEvent(event)) {
251
251
  return {
252
- x: event.pageX,
253
- y: event.pageY
252
+ x: event.clientX,
253
+ y: event.clientY
254
254
  };
255
255
  } else if (isTouchEvent(event)) {
256
256
  const touch = event.touches[0];
257
- if (touch && touch.pageX && touch.pageY) {
257
+ if (touch && touch.clientX && touch.clientY) {
258
258
  return {
259
- x: touch.pageX,
260
- y: touch.pageY
259
+ x: touch.clientX,
260
+ y: touch.clientY
261
261
  };
262
262
  }
263
263
  }
@@ -235,15 +235,15 @@ function isTouchEvent(event) {
235
235
  function getResizeEventCoordinates(event) {
236
236
  if (isMouseEvent(event)) {
237
237
  return {
238
- x: event.pageX,
239
- y: event.pageY
238
+ x: event.clientX,
239
+ y: event.clientY
240
240
  };
241
241
  } else if (isTouchEvent(event)) {
242
242
  const touch = event.touches[0];
243
- if (touch && touch.pageX && touch.pageY) {
243
+ if (touch && touch.clientX && touch.clientY) {
244
244
  return {
245
- x: touch.pageX,
246
- y: touch.pageY
245
+ x: touch.clientX,
246
+ y: touch.clientY
247
247
  };
248
248
  }
249
249
  }
@@ -211,15 +211,15 @@ function isTouchEvent(event) {
211
211
  function getResizeEventCoordinates(event) {
212
212
  if (isMouseEvent(event)) {
213
213
  return {
214
- x: event.pageX,
215
- y: event.pageY
214
+ x: event.clientX,
215
+ y: event.clientY
216
216
  };
217
217
  } else if (isTouchEvent(event)) {
218
218
  const touch = event.touches[0];
219
- if (touch && touch.pageX && touch.pageY) {
219
+ if (touch && touch.clientX && touch.clientY) {
220
220
  return {
221
- x: touch.pageX,
222
- y: touch.pageY
221
+ x: touch.clientX,
222
+ y: touch.clientY
223
223
  };
224
224
  }
225
225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-resizable-panels",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "React components for resizable panel groups/layouts",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
6
6
  "license": "MIT",
@@ -4,15 +4,15 @@ import { isMouseEvent, isTouchEvent } from ".";
4
4
  export function getResizeEventCoordinates(event: ResizeEvent) {
5
5
  if (isMouseEvent(event)) {
6
6
  return {
7
- x: event.pageX,
8
- y: event.pageY,
7
+ x: event.clientX,
8
+ y: event.clientY,
9
9
  };
10
10
  } else if (isTouchEvent(event)) {
11
11
  const touch = event.touches[0];
12
- if (touch && touch.pageX && touch.pageY) {
12
+ if (touch && touch.clientX && touch.clientY) {
13
13
  return {
14
- x: touch.pageX,
15
- y: touch.pageY,
14
+ x: touch.clientX,
15
+ y: touch.clientY,
16
16
  };
17
17
  }
18
18
  }