Skip to content

Commit

Permalink
[EuiModal] Permanently fix EuiModal to scroll-jumping issues, remov…
Browse files Browse the repository at this point in the history
…e temporary workaround (#6360)

* Update react-focus-on

* Remove old scroll workaround and use new react-focus-on API

* [misc] remove old/outdated comment

* changelog

* Update snapshot changes (caused by react-focus-on upgrade?)
  • Loading branch information
Constance authored Nov 16, 2022
1 parent 8d95c81 commit d8b3362
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 528 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"react-beautiful-dnd": "^13.1.0",
"react-dropzone": "^11.5.3",
"react-element-to-jsx-string": "^14.3.4",
"react-focus-on": "^3.5.4",
"react-focus-on": "^3.7.0",
"react-input-autosize": "^3.0.0",
"react-is": "^17.0.2",
"react-virtualized-auto-sizer": "^1.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
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"
>
Expand Down Expand Up @@ -56,11 +51,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
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"
>
Expand Down Expand Up @@ -103,11 +93,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>,
<div
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"
>
Expand Down Expand Up @@ -153,11 +138,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
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"
>
Expand Down Expand Up @@ -199,11 +179,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
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"
>
Expand Down Expand Up @@ -239,11 +214,6 @@ Array [

exports[`EuiCollapsibleNav props isDocked 1`] = `
Array [
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>,
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -275,11 +245,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
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"
>
Expand Down Expand Up @@ -325,11 +290,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="-1"
/>,
<div
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="disabled"
>
Expand All @@ -356,11 +316,6 @@ Array [
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
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"
>
Expand Down
50 changes: 0 additions & 50 deletions src/components/datagrid/__snapshots__/data_grid.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,6 @@ exports[`EuiDataGrid render column actions renders various column actions config

exports[`EuiDataGrid rendering renders additional toolbar controls 1`] = `
Array [
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>,
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -927,11 +922,6 @@ Array [

exports[`EuiDataGrid rendering renders control columns 1`] = `
Array [
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>,
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1235,11 +1225,6 @@ Array [
style="position:absolute;left:0;top:0;height:34px;width:50px"
tabindex="-1"
>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1350,11 +1335,6 @@ Array [
style="position:absolute;left:250px;top:0;height:34px;width:50px"
tabindex="-1"
>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1401,11 +1381,6 @@ Array [
style="position:absolute;left:0;top:0;height:34px;width:50px"
tabindex="-1"
>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1516,11 +1491,6 @@ Array [
style="position:absolute;left:250px;top:0;height:34px;width:50px"
tabindex="-1"
>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1567,11 +1537,6 @@ Array [
style="position:absolute;left:0;top:0;height:34px;width:50px"
tabindex="-1"
>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1682,11 +1647,6 @@ Array [
style="position:absolute;left:250px;top:0;height:34px;width:50px"
tabindex="-1"
>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -1742,11 +1702,6 @@ Array [

exports[`EuiDataGrid rendering renders custom column headers 1`] = `
Array [
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>,
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down Expand Up @@ -2212,11 +2167,6 @@ Array [

exports[`EuiDataGrid rendering renders with common and div attributes 1`] = `
Array [
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
tabindex="-1"
/>,
<div
data-focus-guard="true"
style="width:1px;height:0px;padding:0;overflow:hidden;position:fixed;top:1px;left:1px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

exports[`useDataGridKeyboardShortcuts returns a popover containing a list of keyboard shortcuts 1`] = `
<body>
<div
aria-hidden="true"
data-aria-hidden="true"
>
<div>
<div
class="euiPopover euiPopover-isOpen emotion-euiPopover"
data-test-subj="dataGridKeyboardShortcutsPopover"
Expand Down Expand Up @@ -37,19 +34,10 @@ exports[`useDataGridKeyboardShortcuts returns a popover containing a list of key
data-euiportal="true"
>
<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"
>
Expand Down Expand Up @@ -252,8 +240,6 @@ exports[`useDataGridKeyboardShortcuts returns a popover containing a list of key
</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"
Expand Down
Loading

0 comments on commit d8b3362

Please sign in to comment.