Commit Graph

1624 Commits

Author SHA1 Message Date
Kyle Fang
7b021c56f0 feat: add logbox functions 2020-10-31 14:41:16 +08:00
Nicolas Gallagher
6624a70cca 0.14.7 2020-10-30 10:52:37 -07:00
Nicolas Gallagher
5806b249dd [fix] Use browser expansion of 'flex' style
Fix #1792
2020-10-30 10:47:32 -07:00
Nicolas Gallagher
1048f7ce3e 0.14.6 2020-10-29 17:14:39 -07:00
Nicolas Gallagher
18f5a33c0d [fix] Don't require mocking window.matchMedia in jest
For people who don't mock unsupported DOM APIs for jsdom in their jest setup.

Fix #1789
2020-10-29 17:13:47 -07:00
Nicolas Gallagher
07e578edb8 [fix] ResponderSystem negotiation logic
This fixes a bug in the negotiation logic that caused a cycle of
terminate->grant events to be sent to the current responder during a pointer
move. The root cause was using an incorrect event path in the calculation of
the lowest common ancestor's index. The fix is to ensure that the event path
stored with the current responder is pruned to begin with the node that is the
current responder (rather than any child responders it may have contained).
2020-10-29 17:13:46 -07:00
Nicolas Gallagher
d2e6c29e25 [fix] Pan interactions should cancel 'click' events on the target
If a pan interaction has taken place, it is not expected that 'click' events
occur on the target element when the pointer is released (as was occuring with
mouse pointers). This patch cancels any 'click' that occurs within the pan
target's subtree, within 250ms of the pan gesture ending.

Fix #1788
2020-10-29 17:13:42 -07:00
Nicolas Gallagher
03897d32be [fix] Disabled pressables should propagate 'click' events
If a pressable is disabled it should not prevent the propagation of native
'click' events, unless the underlying DOM node has an 'aria-role' of 'button'.
This emulates the native '<button>' behavior.

Fix #1781
2020-10-29 15:57:35 -07:00
Nicolas Gallagher
b8fddcf6b1 0.14.5 2020-10-27 11:06:27 -07:00
Charlie Croom
d9c755dff0 [fix] Enter key handling for components explicitly given accessible prop
Close #1783
2020-10-27 10:54:24 -07:00
burakgormek
63c39454de [fix] Pressable disabled cursor state
Close #1782
2020-10-27 10:54:18 -07:00
Nicolas Gallagher
89be8a9f8b Fix ViewProps import path
This error was not surfaced by Flow locally but surfaced in CI.
2020-10-22 12:28:17 -07:00
Nicolas Gallagher
b4e53e8cd3 0.14.4 2020-10-22 11:00:02 -07:00
Charlie Croom
cea4172efb [fix] Prevent onClick being called when certain roles are disabled
Fix #1779
Close #1780
2020-10-22 10:56:40 -07:00
Charlie Croom
a2d72ee89c [fix] Avoid usePlatformMethods excess ref creation
Close #1777
2020-10-22 10:35:13 -07:00
Nicolas Gallagher
2428b6c6fc 0.14.3 2020-10-19 16:02:22 -07:00
Nicolas Gallagher
0aa77685aa [fix] Add matrix transform style
Remove the deprecated 'transformMatrix' style prop and support 'matrix' and
'matrix3d' in the 'transform' prop.

Fix #1771
2020-10-19 15:50:02 -07:00
Nicolas Gallagher
663458713c 0.14.2 2020-10-16 12:57:49 -07:00
TikiTDO
3118315140 [fix] Remove 'collapsable' prop from createAnimatedComponent
This is an Android-only prop that has no platform guard in React Native. The
web has a native 'collapsable' prop that React DOM complains about when it is
not a string value.

Close #1767
2020-10-16 12:55:51 -07:00
Charlie Croom
09c2f1975b [fix] Prevent constant Image reloading when source given as an object
Close #1770
2020-10-16 12:55:48 -07:00
Charlie Croom
18d5d449a7 [fix] Callback ref less on Views by making classList constant
Close #1766
2020-10-16 12:33:58 -07:00
Nicolas Gallagher
933bd138ce 0.14.1 2020-10-12 13:41:20 -07:00
Nicolas Gallagher
c2019a9881 [fix] Pressable cursor and touch-action styles
Also add unit tests for Pressable.

Fix #1764
2020-10-12 13:37:42 -07:00
Nicolas Gallagher
78174d7b48 0.14.0 2020-10-09 12:59:41 -07:00
Nicolas Gallagher
38fd574984 [add] Pressable support for hover state
This patch ports the 'useHover' hook to React Native for Web, providing hover
state that is scoped to a pressable and does not bubble to ancestor pressables.
This behavior aligns with the behavior of the focus and press states.

Fix #1708
2020-10-09 11:35:36 -07:00
Nicolas Gallagher
5b7a6bc30a Move hooks into 'modules' directory 2020-10-09 11:35:35 -07:00
James Ward
d97a1ca567 [add] Modal component
This adds support for the React Native Modal on web.

The app content is hidden from screen readers by setting the aria-modal flag on
the modal. This focus is trapped within the modal, both when attempting to
focus elsewhere using the mouse as well as when attempting to focus elsewhere
using the keyboard. A built-in "Escape to close" mechanism is been implemented
that calls 'onRequestClose' for the active modal.

Close #1646
Fix #1020
2020-10-09 11:32:31 -07:00
Nicolas Gallagher
6bd41a622a Remove react-dom vendor directory 2020-10-09 11:32:30 -07:00
Nicolas Gallagher
108366a724 [change] Default flex-basis value of Views
React Native has an implementation of flexbox that does not quite follow the
W3C spec for flexbox. Previously, React Native for Web attempted to replicate
the React Native rendering by setting flexBasis to 0%. However, this created
its own problems where views could collapse down to 0px in height on the web.
This patch relies sets the default flexBasis back to 'auto'. This will cause
different rendering inconsistencies with React Native, which can be addressed
by making changes to existing React Native styles. And ultimately, it is up to
Yoga to correct its flexbox implementation.

Fix #1640
Fix #1604
Fix #1264
Close #1265
2020-10-09 11:32:30 -07:00
Nicolas Gallagher
bf2e10d482 0.13.18 2020-10-09 11:17:09 -07:00
Mark Lawlor
faf7fa3374 [fix] skip ResizeObserver warning during SSR
Close #1762
2020-10-09 11:14:00 -07:00
Nicolas Gallagher
df14c7278a 0.13.17 2020-10-08 12:29:11 -07:00
Nicolas Gallagher
b15e8784c4 Add unit tests for ref imperative methods 2020-10-08 12:27:15 -07:00
Nicolas Gallagher
583e16fa8d Memoize refs
Refs can be memoized following the fix in the previous commit.

Fix #1755
Fix #1665
2020-10-07 15:28:34 -07:00
Nicolas Gallagher
b4322734a2 [fix] Order of ref merging
Ensure internal refs are called before the forwardedRef. This ensures that the
DOM element mutation performed by usePlatformMethods occurs before user-space
refs are called.

Ref #1749
2020-10-07 15:28:33 -07:00
Nicolas Gallagher
bdcb4de7dc 0.13.16 2020-10-06 11:41:31 -07:00
Nicolas Gallagher
d8ee51e326 [fix] CSS scrollbarWidth
The previous code wasn't inserting the W3C rule because it had the same selector as the rule for proprietary styles. However, the Firefox value isn't supported anymore, and the Edge value is unnecessary as Edge uses Blink now. This patch removes the non-WebKit fallback styles for this property.

Fix #1760
2020-10-06 11:38:17 -07:00
Nicolas Gallagher
aad0c88cea 0.13.15 2020-10-05 15:38:06 -07:00
Nicolas Gallagher
6d04e7243e [fix] Don't propagate click or contextmenu events on disabled elements
This patch fixes the PressResponder to avoid propagating click and contextmenu
events in all circumstances. It also prevents click propagating for focusable
elements that are disabled, mirroring the behavior of native buttons when
disabled.

Fix #1757
2020-10-05 15:33:50 -07:00
Julian Hundeloh
ba5e9e3079 [add] AccessibilityInfo isReduceMotionEnabled
Close #1754
2020-10-05 14:51:41 -07:00
Shobhit Chittora
06d3cadf05 Update docs suggested preset to metro-react-native-babel-preset
Updating the document as `babel-preset-react-native` is deprecated in favor for
`metro-react-native-babel-preset`. More info here -
https://www.npmjs.com/package/babel-preset-react-native.

Close #1751
2020-10-05 14:48:38 -07:00
Nicolas Gallagher
72bfe499c5 Add to View tests 2020-10-05 14:28:27 -07:00
Nicolas Gallagher
92ac1f94c5 Add to Text tests 2020-10-05 13:20:28 -07:00
Nicolas Gallagher
5edba02319 Add to Image tests 2020-10-05 13:16:13 -07:00
Nicolas Gallagher
2276e17310 Add to CheckBox tests 2020-10-05 13:16:12 -07:00
Nicolas Gallagher
222fa3490e Add to Button tests 2020-10-05 13:16:11 -07:00
Nicolas Gallagher
0fb3036f31 Add to ActivityIndicator tests 2020-10-05 13:16:11 -07:00
Nicolas Gallagher
7bc6fc8347 0.13.14 2020-09-24 13:39:37 -07:00
Nicolas Gallagher
c60417ab34 [fix] Revert ref memoization
Memoizing refs caused unexpected regressions in some class component patterns.
The memoization is being reverted for now.

Fix #1749
2020-09-24 13:26:21 -07:00
Nicolas Gallagher
af0d80a808 0.13.13 2020-09-21 15:56:18 -07:00