@testing-library/user-event 14.2.2 → 14.2.3

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/dist/index.cjs CHANGED
@@ -1744,7 +1744,7 @@ function prepareInterceptor(element, propName, interceptorImpl) {
1744
1744
  }
1745
1745
  function intercept(...args) {
1746
1746
  const {
1747
- applyNative = true,
1747
+ applyNative = false,
1748
1748
  realArgs,
1749
1749
  then
1750
1750
  } = interceptorImpl.call(this, ...args);
@@ -1767,13 +1767,14 @@ function prepareInterceptor(element, propName, interceptorImpl) {
1767
1767
  // src/document/selection.ts
1768
1768
  var UISelection = Symbol("Displayed selection in UI");
1769
1769
  function prepareSelectionInterceptor(element) {
1770
- prepareInterceptor(element, "setSelectionRange", function interceptorImpl(start, end, direction = "none") {
1770
+ prepareInterceptor(element, "setSelectionRange", function interceptorImpl(start, ...others) {
1771
1771
  const isUI = start && typeof start === "object" && start[UISelection];
1772
1772
  if (!isUI) {
1773
1773
  this[UISelection] = void 0;
1774
1774
  }
1775
1775
  return {
1776
- realArgs: [Number(start), end, direction]
1776
+ applyNative: !!isUI,
1777
+ realArgs: [Number(start), ...others]
1777
1778
  };
1778
1779
  });
1779
1780
  prepareInterceptor(element, "selectionStart", function interceptorImpl(v) {
package/dist/index.mjs CHANGED
@@ -1754,7 +1754,7 @@ function prepareInterceptor(element, propName, interceptorImpl) {
1754
1754
  }
1755
1755
  function intercept(...args) {
1756
1756
  const {
1757
- applyNative = true,
1757
+ applyNative = false,
1758
1758
  realArgs,
1759
1759
  then
1760
1760
  } = interceptorImpl.call(this, ...args);
@@ -1776,13 +1776,14 @@ function prepareInterceptor(element, propName, interceptorImpl) {
1776
1776
  // src/document/selection.ts
1777
1777
  var UISelection = Symbol("Displayed selection in UI");
1778
1778
  function prepareSelectionInterceptor(element) {
1779
- prepareInterceptor(element, "setSelectionRange", function interceptorImpl(start, end, direction = "none") {
1779
+ prepareInterceptor(element, "setSelectionRange", function interceptorImpl(start, ...others) {
1780
1780
  const isUI = start && typeof start === "object" && start[UISelection];
1781
1781
  if (!isUI) {
1782
1782
  this[UISelection] = void 0;
1783
1783
  }
1784
1784
  return {
1785
- realArgs: [Number(start), end, direction]
1785
+ applyNative: !!isUI,
1786
+ realArgs: [Number(start), ...others]
1786
1787
  };
1787
1788
  });
1788
1789
  prepareInterceptor(element, "selectionStart", function interceptorImpl(v) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testing-library/user-event",
3
- "version": "14.2.2",
3
+ "version": "14.2.3",
4
4
  "description": "Fire events the same way the user does",
5
5
  "keywords": [
6
6
  "react-testing-library",