Commit Graph
100 Commits
Author SHA1 Message Date
Nicolas Gallagher 5726d83544 [fix] Pressable supports onContextMenu prop
Fix #2004
2021-04-29 17:01:05 -07:00
Nicolas Gallagher 8362f3907f 0.16.1 2021-04-23 11:09:26 -07:00
Nicolas Gallagher 2d9dca42fa 0.16.0 2021-04-20 12:19:56 -07:00
Nicolas Gallagher ab5d11953d Update documentation for 0.16 2021-04-20 10:46:52 -07:00
Nicolas Gallagher 4a4c4d2461 Deduplicate yarn.lock
Close #1981
2021-04-20 10:44:46 -07:00
Nicolas Gallagher 89cf78d529 [change] Fix the Dimensions.window value
Fixes issues in Safari from using window.innerWidth. Using
documentElement.clientWidth doesn't have issues and provides a more practical
value for the canvas width that excludes the width of scrollbars.

Fix #1369
Fix #1905
2021-04-20 10:44:46 -07:00
Nicolas Gallagher 4e77aebc17 Fix flow error in useEvent 2021-04-20 10:44:45 -07:00
Nicolas Gallagher 7293a613d5 Add unit tests for setNativeProps style mutation 2021-04-20 10:33:03 -07:00
Nicolas Gallagher 9d6d39f2c7 0.15.7 2021-04-13 12:42:07 -07:00
Nicolas Gallagher 9edddb16ba Revert "[fix] setNativeProps logic"
This reverts commit c0abdbfaae.

Fix #1987
2021-04-13 12:40:23 -07:00
Nicolas Gallagher 6f744815ab Make corrections to TextInput docs
Close #1977
2021-04-07 13:43:28 -07:00
Nicolas Gallagher 6bfd80cc56 0.15.6 2021-04-06 17:17:15 -07:00
Nicolas Gallagher d73509db74 [fix] PanResponder move event filtering
Fix #1853
2021-04-06 17:13:59 -07:00
Nicolas Gallagher 6fa5353457 0.15.5 2021-03-30 19:09:29 -07:00
Nicolas Gallagher ae87e1e459 [fix] ScrollView ref and methods
Make sure the 'ref' for a ScrollView is a host node with React Native's
proprietary and legacy instance methods attached.

Fix #1957
2021-03-30 18:58:24 -07:00
Nicolas Gallagher fc4cc216a1 0.15.4 2021-03-30 15:13:19 -07:00
Nicolas Gallagher 0ac406c91e 0.15.3 2021-03-29 13:50:09 -07:00
Nicolas Gallagher 09fbe85d10 [fix] Pressable supports onKeyDown prop
Fix #1950
Close #1951
2021-03-29 13:33:55 -07:00
Nicolas Gallagher 71f1e9bf3a [fix] Allow href 'target' string to start with underscore
Fix #1963
Close #1937
2021-03-29 12:47:19 -07:00
Nicolas Gallagher 92f577ea26 Fix docs on imperative focus
Fix #1916
2021-03-29 12:47:07 -07:00
Nicolas Gallagher 833d55bae4 0.15.2 2021-03-29 11:27:28 -07:00
Nicolas Gallagher 889827e3a4 Add accessibilityLevel to docs 2021-03-26 14:26:57 -07:00
Nicolas Gallagher 35a85af483 Fix formatting error in docs 2021-03-26 14:22:43 -07:00
Nicolas Gallagher 457d406714 0.15.1 2021-03-26 14:17:05 -07:00
Nicolas Gallagher dd79d87783 [fix] accessibilityLevel should control semantic tag
Fix #1965
2021-03-26 14:10:56 -07:00
c6be829fb1 Various documentation fixes
Fix #1948
Close #1906
Close #1918
Close #1922
Close #1956
Close #1960

Co-authored-by: Nishan <nishanbende@gmail.com>
Co-authored-by: Michel Couillard <mcouillard@hortau.com>
Co-authored-by: David Calhoun <dpcalhoun@gmail.com>
Co-authored-by: burakgormek <burak.gormek@gmail.com>
Co-authored-by: Evan Charlton <evancharlton@microsoft.com>
2021-03-25 12:51:05 -07:00
Nicolas Gallagher d037506200 Fix codesandbox path in docs 2021-02-12 10:57:58 -08:00
Nicolas Gallagher c47bec7b93 0.15.0 2021-02-12 10:54:39 -08:00
Nicolas Gallagher f6aed0534d Fix package.json scripts 2021-02-12 10:45:23 -08:00
Nicolas Gallagher 51f9ab73e4 Fix accessibility props forwarding
Reintroduce 'accessible' and deprecate.
2021-02-11 15:02:27 -08:00
Nicolas Gallagher 7331c73f1e Update create-react-class dependency 2021-02-11 14:58:09 -08:00
Nicolas Gallagher 325fcbf5a0 Update pre-commit checks 2021-02-11 14:58:08 -08:00
Nicolas Gallagher 09ebf7bab5 Update benchmarks dependencies
Remove styled-jsx as it now throws "_JSXStyle is not defined". Library isn't
particularly fast and each update causes issues. Drop it.
2021-02-11 14:58:08 -08:00
Nicolas Gallagher 26b8a7e164 Update react-native-web runtime dependencies 2021-02-11 14:58:08 -08:00
Nicolas Gallagher 4868b460d7 Update misc cli dependencies 2021-02-11 14:58:08 -08:00
Nicolas Gallagher a5d6cd51ef Update prettier and reformat code 2021-02-11 14:58:05 -08:00
Nicolas Gallagher 86b8048012 Update linter dependencies 2021-02-11 14:53:11 -08:00
Nicolas Gallagher 94ae8a4a0b Update test dependencies 2021-02-11 14:53:11 -08:00
Nicolas Gallagher 2471561962 Update Babel dependencies 2021-02-11 14:53:10 -08:00
Nicolas Gallagher c8e8094247 [fix] Allow CSS aspectRatio
Fix #427
2021-02-11 14:53:10 -08:00
Nicolas Gallagher 7b0365272c New documentation site and examples app
Replaces the old storybook with static HTML documentation and an interactive
examples app. The documentation is now easier to customize, easier to maintain,
and faster to load. The interactive examples are a dedicated Next.js app that
can be loaded and edited in codesandbox, as well as embedded in the
documentation where needed.
2021-02-11 14:53:04 -08:00
Nicolas Gallagher 2e7e5631f9 Remove storybook docs and examples 2021-02-06 09:12:41 -08:00
Nicolas Gallagher a685f2db2e [change] I18nManager getConstants method
React Native made a breaking change to the (undocumented) I18nManager that
makes the 'isRTL' constant available via the 'getConstants' method. This
removes the getter properties that were previously needed.
2021-02-06 09:12:40 -08:00
Nicolas Gallagher 6a8369dd95 Fix types 2021-02-06 09:12:40 -08:00
Nicolas Gallagher 6efe1f90c2 [change] Add hrefAttrs prop to Text and View
When an 'href' is provided, the 'hrefAttr's prop can be used to set the 'download', 'rel', and 'target' attributes. The 'target' value does not require a "_" prefix.
2021-02-06 09:12:40 -08:00
Nicolas Gallagher 683962b961 [add] Pressable support for hover callbacks
Add 'onHoverIn' and 'onHoverOut' props to Pressable.

Fix #1804
2021-02-06 09:12:34 -08:00
Nicolas Gallagher d6d28a4886 [add] More role to component mappings 2021-02-05 15:54:56 -08:00
Nicolas Gallagher 7e70b924ec [add] Accessibility props for all ARIA attributes
Adds support for all ARIA equivalents via "accessibility*" props.
2021-02-05 14:45:19 -08:00
Nicolas Gallagher abf00ef9b3 [change] Introduce focusable prop and remove deprecated props
* Adds "focusable" as a replacement for "accessible". This is aligned with RN for Windows.
* Remove "data-focusable" DOM attribute.
* Remove "importantForAccessibility" as this was previously deprecated.
* Remove undocumented "disabled" prop; replaced with "accessibilityDisabled"

Fix #1886
2021-02-05 13:56:51 -08:00
Nicolas Gallagher 956b4a3d74 [change] Remove automatic addition of 'rel="noopener"' from links
Close #1428
2021-02-05 13:56:41 -08:00
Nicolas Gallagher b7b383098a [change] Linking.openURL() opens in new tab.
Fix #1544
Close #1432
Close #1743
2021-02-05 13:56:41 -08:00
Nicolas Gallagher 744b61972f [change] React 17 peer dependency
React 17 changed how blur/focus events are implemented, which requires a small
change to several unit tests to ensure the relevant DOM events are dispatched.
2021-02-05 13:56:39 -08:00
Nicolas Gallagher f5c9f63723 0.14.13 2021-02-05 13:55:00 -08:00
Nicolas Gallagher 4b8cd20aaa 0.14.12 2021-02-04 12:47:23 -08:00
Nicolas Gallagher 29b13262c3 Add label-actions workflow
This workflow allows GitHub to automatically act on issue in response to labels
being added to the issue.
2021-02-01 16:33:02 -08:00
Nicolas Gallagher 8bc196afde Workflow rename: test -> tests 2021-01-29 14:00:59 -08:00
Nicolas Gallagher d48f59102f 0.14.11 2021-01-29 13:39:45 -08:00
Nicolas Gallagher 6739ab95cf 0.14.10 2020-12-17 13:51:03 -08:00
Nicolas Gallagher 4a1b31e3ef Use GitHub workflows for CI
Close #1845
Fix #1841
2020-12-14 13:04:07 -08:00
Nicolas Gallagher e03ac45173 Update benchmark libraries
Remove the slow and rarely-used libraries from the suite of implementations.
Update the remaining packages.

Close #1838
2020-12-08 12:50:22 -08:00
Nicolas Gallagher 751f7ec6db [fix] Allow unitless numbers for CSS grid properties 2020-12-08 11:23:16 -08:00
Nicolas Gallagher c4e0fd7ab5 0.14.9 2020-12-04 11:47:36 -08:00
Nicolas Gallagher 624b9ddec0 [fix] Modal z-index
The z-index must be applied to the outer element (or even the portal element)
if the portal is to stack relative to other silbings. Previously, the z-index
was only relative to the outer Modal element which had a non-static position.

Fix #1820
2020-12-04 11:31:46 -08:00
Nicolas Gallagher 366f0e9923 Fix TouchableOpacity onPressStart with React 17
React 17 changed something that means the dispatchConfig is not included in
synthetic events.

Fix #1833
2020-12-03 12:50:26 -08:00
Nicolas Gallagher 6928fab9e0 0.14.8 2020-11-09 15:57:38 -08:00
Nicolas Gallagher e5ded58972 [fix] ScrollView doesn't respond to descendant scroll events
Workaround for React DOM's non-standard bubbling of scroll events.

Fix #1800
2020-11-09 15:46:48 -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
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
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
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
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
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
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