@canlooks/can-ui 0.0.73 → 0.0.74

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.
@@ -14,7 +14,10 @@ exports.TouchRipple = (0, react_1.memo)(({ color = 'primary', container, effectC
14
14
  (0, react_1.useEffect)(() => {
15
15
  const parentElement = containerEl.current ?? ref.current.parentElement;
16
16
  if (parentElement) {
17
- const pointerDown = ({ offsetX, offsetY }) => {
17
+ const pointerDown = ({ clientX, clientY }) => {
18
+ const { left, top } = parentElement.getBoundingClientRect();
19
+ const offsetX = clientX - left;
20
+ const offsetY = clientY - top;
18
21
  const maxWidth = Math.max(parentElement.clientWidth - offsetX, offsetX);
19
22
  const maxHeight = Math.max(parentElement.clientHeight - offsetY, offsetY);
20
23
  setRipples(o => {
@@ -11,7 +11,10 @@ export const TouchRipple = memo(({ color = 'primary', container, effectContainer
11
11
  useEffect(() => {
12
12
  const parentElement = containerEl.current ?? ref.current.parentElement;
13
13
  if (parentElement) {
14
- const pointerDown = ({ offsetX, offsetY }) => {
14
+ const pointerDown = ({ clientX, clientY }) => {
15
+ const { left, top } = parentElement.getBoundingClientRect();
16
+ const offsetX = clientX - left;
17
+ const offsetY = clientY - top;
15
18
  const maxWidth = Math.max(parentElement.clientWidth - offsetX, offsetX);
16
19
  const maxHeight = Math.max(parentElement.clientHeight - offsetY, offsetY);
17
20
  setRipples(o => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/can-ui",
3
- "version": "0.0.73",
3
+ "version": "0.0.74",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "My ui framework",
6
6
  "license": "MIT",