fix(Dialog): support nested Dialogs and Popups#1706
Conversation
| export type GetContextRefs = (needleRef: NodeRef) => NodeRef[] | ||
| export type GetRefs = () => NodeRef[] | ||
| export type NodeRef<T extends Node = Node> = React.RefObject<T> | ||
| export type NodeRef<T extends Node = Node> = React.MutableRefObject<T> |
There was a problem hiding this comment.
There refs are mutable, it allows to avoid usage of handleRef or @tsignore
| "module": "esnext" | ||
| }, | ||
| "include": ["../packages/react/src", "../e2e", "../types"] | ||
| } |
There was a problem hiding this comment.
Add tsconfig.json to get proper autocomplete
| @@ -1,29 +0,0 @@ | |||
| import * as React from 'react' | |||
There was a problem hiding this comment.
Cruft, this function is a part of @stardust-ui/react-component-ref
| export type TriggerAccessibility = { | ||
| attributes?: AccessibilityAttributes | ||
| keyHandlers?: AccessibilityKeyHandlers | ||
| keyHandlers?: AccessibilityHandlerProps |
There was a problem hiding this comment.
Type was wrong previously
e2e/e2eApi.ts
Outdated
| return { x: Math.round(rect.left), y: Math.round(rect.top) } | ||
| }, selector) | ||
|
|
||
| await this.page.mouse.click(dimensions.x + x, dimensions.y + y) |
There was a problem hiding this comment.
https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageclickselector-options
This method fetches an element with selector, scrolls it into view if needed, and then uses page.mouse to click in the center of the element. If there's no element matching selector, the method throws an error.
To make this test working I need a different behavior because the center of overlay is content and click will be ignored
Codecov Report
@@ Coverage Diff @@
## master #1706 +/- ##
==========================================
- Coverage 71.17% 71.17% -0.01%
==========================================
Files 858 858
Lines 7106 7111 +5
Branches 2033 2054 +21
==========================================
+ Hits 5058 5061 +3
- Misses 2042 2044 +2
Partials 6 6
Continue to review full report at Codecov.
|
Co-Authored-By: Marija Najdova <mnajdova@gmail.com>
Co-Authored-By: Marija Najdova <mnajdova@gmail.com>
mnajdova
left a comment
There was a problem hiding this comment.
Changed look good to me, please check one last time with accessibility team whether everything works as expected
|
Confirmed this with @jurokapsiar, however we found another issue #1709 that should be fixed separately. |
* add nesting registry * wip * add prototype * add E2E tests * remove console.log * add changelog entry * fix dangerjs issue * Update e2e/tests/dialogInPopup-test.ts Co-Authored-By: Marija Najdova <mnajdova@gmail.com> * Update e2e/tests/dialogInDialog-test.ts Co-Authored-By: Marija Najdova <mnajdova@gmail.com> * update test header * use boundingBox * update method (cherry picked from commit 5afe10c)
Fixes #1674.
This PR:
Unstable_NestingAutocomponent, same thing as inPopupPopups andDialogs