forked from elastic/eui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiModal] Temporary workaround for scroll-jumping behavior (elastic#…
…6327) * Add removable workaround until react-focus-on supports focusOptions * unit tests - convert modal tests to RTL; add removable scroll/focus test * [misc bugfix] Remove body width & scroll jumping occurring in Chrome - use `react-focus-on`'s scrollLock API to prevent this (they manage preserving the width of the scrollbar for us) * changelog
- Loading branch information
1 parent
869f130
commit 599ffd2
Showing
4 changed files
with
108 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,61 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders EuiModal 1`] = ` | ||
Array [ | ||
exports[`EuiModal renders 1`] = ` | ||
<body> | ||
<div | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="0" | ||
/>, | ||
/> | ||
<div | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="1" | ||
/>, | ||
<div | ||
data-focus-lock-disabled="false" | ||
class="euiOverlayMask emotion-euiOverlayMask-aboveHeader" | ||
data-euiportal="true" | ||
data-relative-to-header="above" | ||
> | ||
<div | ||
aria-label="aria-label" | ||
class="euiModal euiModal--maxWidth-default testClass1 testClass2" | ||
data-test-subj="test subject string" | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="0" | ||
/> | ||
<div | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="1" | ||
/> | ||
<div | ||
data-focus-lock-disabled="false" | ||
> | ||
<button | ||
aria-label="Closes this modal window" | ||
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles" | ||
type="button" | ||
<div | ||
aria-label="aria-label" | ||
class="euiModal euiModal--maxWidth-default testClass1 testClass2" | ||
data-test-subj="test subject string" | ||
tabindex="0" | ||
> | ||
<span | ||
aria-hidden="true" | ||
class="euiButtonIcon__icon" | ||
color="inherit" | ||
data-euiicon-type="cross" | ||
/> | ||
</button> | ||
children | ||
<button | ||
aria-label="Closes this modal window" | ||
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles" | ||
type="button" | ||
> | ||
<span | ||
aria-hidden="true" | ||
class="euiButtonIcon__icon" | ||
color="inherit" | ||
data-euiicon-type="cross" | ||
/> | ||
</button> | ||
children | ||
</div> | ||
</div> | ||
</div>, | ||
<div | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="0" | ||
/>, | ||
] | ||
<div | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="0" | ||
/> | ||
</div> | ||
</body> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**Bug fixes** | ||
|
||
- Temporarily patched `EuiModal` to not cause scroll-jumping issues on modal open |