@office-iss/react-native-win32 0.71.12 → 0.71.13

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.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 06 Jul 2023 20:21:09 GMT",
5
+ "date": "Fri, 04 Aug 2023 23:48:53 GMT",
6
+ "tag": "@office-iss/react-native-win32_v0.71.13",
7
+ "version": "0.71.13",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "email not defined",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "958bd7b3a1d65a3cd4076bed410c0cb1b5675740",
14
+ "comment": "add isDefaultButton check to win32"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Thu, 06 Jul 2023 20:21:35 GMT",
6
21
  "tag": "@office-iss/react-native-win32_v0.71.12",
7
22
  "version": "0.71.12",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,25 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Thu, 06 Jul 2023 20:21:09 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 04 Aug 2023 23:48:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.71.12
7
+ ## 0.71.13
8
8
 
9
- Thu, 06 Jul 2023 20:21:09 GMT
9
+ Fri, 04 Aug 2023 23:48:53 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Update core 0.71.6 -> 0.71.12 (30809111+acoates-ms@users.noreply.github.com)
13
+ - add isDefaultButton check to win32 (email not defined)
14
14
 
15
+ ## 0.71.12
16
+
17
+ Thu, 06 Jul 2023 20:21:35 GMT
18
+
19
+ ### Patches
20
+
21
+ - Update core 0.71.6 -> 0.71.12 (30809111+acoates-ms@users.noreply.github.com)
22
+
15
23
  ## 0.71.11
16
24
 
17
25
  Fri, 23 Jun 2023 18:19:55 GMT
@@ -427,6 +427,7 @@ export default class Pressability {
427
427
  |}>;
428
428
  _touchActivateTime: ?number;
429
429
  _touchState: TouchState = 'NOT_RESPONDER';
430
+ _isKeyDown: boolean = false;
430
431
 
431
432
  constructor(config: PressabilityConfig) {
432
433
  this.configure(config);
@@ -468,6 +469,7 @@ export default class Pressability {
468
469
  if (onBlur != null) {
469
470
  onBlur(event);
470
471
  }
472
+ this._isKeyDown = false;
471
473
  },
472
474
  onFocus: (event: FocusEvent): void => {
473
475
  const {onFocus} = this._config;
@@ -596,7 +598,8 @@ export default class Pressability {
596
598
  (event.nativeEvent.code === 'Space' ||
597
599
  event.nativeEvent.code === 'Enter' ||
598
600
  event.nativeEvent.code === 'GamepadA') &&
599
- event.defaultPrevented !== true
601
+ event.defaultPrevented !== true &&
602
+ this._isKeyDown
600
603
  ) {
601
604
  const {onPressOut, onPress} = this._config;
602
605
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
@@ -604,6 +607,8 @@ export default class Pressability {
604
607
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
605
608
  onPress && onPress(event);
606
609
  }
610
+ // Native windows app clears the key pressed state when another key press interrupts the current
611
+ this._isKeyDown = false;
607
612
  },
608
613
  onKeyDown: (event: KeyEvent): void => {
609
614
  const {onKeyDown} = this._config;
@@ -616,6 +621,7 @@ export default class Pressability {
616
621
  event.defaultPrevented !== true
617
622
  ) {
618
623
  const {onPressIn} = this._config;
624
+ this._isKeyDown = true;
619
625
  // $FlowFixMe: PressEvents don't mesh with keyboarding APIs. Keep legacy behavior of passing KeyEvents instead
620
626
  onPressIn && onPressIn(event);
621
627
  }
@@ -780,6 +786,12 @@ export default class Pressability {
780
786
  }
781
787
  }
782
788
 
789
+ // [Win32]
790
+ // $FlowFixMe - button typing
791
+ _isDefaultPressButton(button): boolean {
792
+ return !button; // Treat 0 or undefined as default press
793
+ }
794
+
783
795
  /**
784
796
  * Performs a transition between touchable states and identify any activations
785
797
  * or deactivations (and callback invocations).
@@ -808,7 +820,10 @@ export default class Pressability {
808
820
 
809
821
  if (isPressInSignal(prevState) && signal === 'LONG_PRESS_DETECTED') {
810
822
  const {onLongPress} = this._config;
811
- if (onLongPress != null) {
823
+ if (
824
+ onLongPress != null &&
825
+ this._isDefaultPressButton(getTouchFromPressEvent(event).button)
826
+ ) {
812
827
  onLongPress(event);
813
828
  }
814
829
  }
@@ -829,7 +844,11 @@ export default class Pressability {
829
844
  this._deactivate(event);
830
845
  }
831
846
  const {onLongPress, onPress, android_disableSound} = this._config;
832
- if (onPress != null) {
847
+
848
+ if (
849
+ onPress != null &&
850
+ this._isDefaultPressButton(getTouchFromPressEvent(event).button)
851
+ ) {
833
852
  const isPressCanceledByLongPress =
834
853
  onLongPress != null &&
835
854
  prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' &&
@@ -848,17 +867,20 @@ export default class Pressability {
848
867
 
849
868
  _activate(event: PressEvent): void {
850
869
  const {onPressIn} = this._config;
851
- const {pageX, pageY} = getTouchFromPressEvent(event);
870
+ const {pageX, pageY, button} = getTouchFromPressEvent(event);
852
871
  this._touchActivatePosition = {pageX, pageY};
853
872
  this._touchActivateTime = Date.now();
854
- if (onPressIn != null) {
873
+ if (onPressIn != null && this._isDefaultPressButton(button)) {
855
874
  onPressIn(event);
856
875
  }
857
876
  }
858
877
 
859
878
  _deactivate(event: PressEvent): void {
860
879
  const {onPressOut} = this._config;
861
- if (onPressOut != null) {
880
+ if (
881
+ onPressOut != null &&
882
+ this._isDefaultPressButton(getTouchFromPressEvent(event).button)
883
+ ) {
862
884
  const minPressDuration = normalizeDelay(
863
885
  this._config.minPressDuration,
864
886
  0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.71.12",
3
+ "version": "0.71.13",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "license": "MIT",
6
6
  "main": "./index.win32.js",