Remove focus-visible polyfill (#11677)
* Remove focus-visible polyfill Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update snapshots Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
8e4de798a5
commit
e0f4b26512
15 changed files with 15 additions and 29 deletions
|
@ -84,7 +84,6 @@
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"filesize": "10.0.12",
|
"filesize": "10.0.12",
|
||||||
"focus-visible": "^5.2.0",
|
|
||||||
"gfm.css": "^1.1.2",
|
"gfm.css": "^1.1.2",
|
||||||
"glob-to-regexp": "^0.4.1",
|
"glob-to-regexp": "^0.4.1",
|
||||||
"graphemer": "^1.4.0",
|
"graphemer": "^1.4.0",
|
||||||
|
|
|
@ -230,7 +230,7 @@ textarea:focus {
|
||||||
/* accessible (focusable) components. Not intended for buttons, but */
|
/* accessible (focusable) components. Not intended for buttons, but */
|
||||||
/* should be used on things like focusable containers where the outline */
|
/* should be used on things like focusable containers where the outline */
|
||||||
/* is usually not helping anyone. */
|
/* is usually not helping anyone. */
|
||||||
*:focus:not(.focus-visible) {
|
*:focus:not(:focus-visible) {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ legend {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
&:not(.focus-visible) {
|
&:not(:focus-visible) {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ limitations under the License.
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(.focus-visible) {
|
&:not(:focus-visible) {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ limitations under the License.
|
||||||
--active-color: $slider-background-color;
|
--active-color: $slider-background-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus:not(.focus-visible) {
|
&:focus:not(:focus-visible) {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ limitations under the License.
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.focus-visible {
|
&:focus-visible {
|
||||||
& + label .mx_Checkbox_background {
|
& + label .mx_Checkbox_background {
|
||||||
@mixin unreal-focus;
|
@mixin unreal-focus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ limitations under the License.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.focus-visible {
|
&:focus-visible {
|
||||||
& + div {
|
& + div {
|
||||||
@mixin unreal-focus;
|
@mixin unreal-focus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ $left-gutter: 64px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.focus-visible:focus-within,
|
&:focus-visible:focus-within,
|
||||||
&.mx_EventTile_actionBarFocused,
|
&.mx_EventTile_actionBarFocused,
|
||||||
&.mx_EventTile_isEditing,
|
&.mx_EventTile_isEditing,
|
||||||
&.mx_EventTile_selected {
|
&.mx_EventTile_selected {
|
||||||
|
@ -870,7 +870,7 @@ $left-gutter: 64px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
|
||||||
.mx_EventTile:hover &,
|
.mx_EventTile:hover &,
|
||||||
.mx_EventTile.focus-visible:focus-within & {
|
.mx_EventTile:focus-visible:focus-within & {
|
||||||
border: 1px solid $tertiary-content;
|
border: 1px solid $tertiary-content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -993,7 +993,7 @@ $left-gutter: 64px;
|
||||||
.mx_EventTile:hover .mx_MessageActionBar,
|
.mx_EventTile:hover .mx_MessageActionBar,
|
||||||
.mx_EventTile.mx_EventTile_actionBarFocused .mx_MessageActionBar,
|
.mx_EventTile.mx_EventTile_actionBarFocused .mx_MessageActionBar,
|
||||||
[data-whatinput="keyboard"] .mx_EventTile:focus-within .mx_MessageActionBar,
|
[data-whatinput="keyboard"] .mx_EventTile:focus-within .mx_MessageActionBar,
|
||||||
.mx_EventTile.focus-visible:focus-within .mx_MessageActionBar {
|
.mx_EventTile:focus-visible:focus-within .mx_MessageActionBar {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,7 +1002,7 @@ $left-gutter: 64px;
|
||||||
/* animation for when it's shown which means duplicating the style definition in */
|
/* animation for when it's shown which means duplicating the style definition in */
|
||||||
/* multiple places. */
|
/* multiple places. */
|
||||||
.mx_EventTile:not(:hover):not(.mx_EventTile_actionBarFocused):not([data-whatinput="keyboard"] :focus-within) {
|
.mx_EventTile:not(:hover):not(.mx_EventTile_actionBarFocused):not([data-whatinput="keyboard"] :focus-within) {
|
||||||
&:not(.focus-visible:focus-within) .mx_MessageActionBar .mx_Indicator {
|
&:not(:focus-visible:focus-within) .mx_MessageActionBar .mx_Indicator {
|
||||||
animation: none;
|
animation: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ limitations under the License.
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover .mx_LinkPreviewGroup_hide img,
|
&:hover .mx_LinkPreviewGroup_hide img,
|
||||||
.mx_LinkPreviewGroup_hide.focus-visible:focus img {
|
.mx_LinkPreviewGroup_hide:focus-visible:focus img {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,6 @@ import { CryptoEvent } from "matrix-js-sdk/src/crypto";
|
||||||
import { DecryptionError } from "matrix-js-sdk/src/crypto/algorithms";
|
import { DecryptionError } from "matrix-js-sdk/src/crypto/algorithms";
|
||||||
import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup";
|
import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup";
|
||||||
|
|
||||||
// focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by various components
|
|
||||||
import "focus-visible";
|
|
||||||
// what-input helps improve keyboard accessibility
|
// what-input helps improve keyboard accessibility
|
||||||
import "what-input";
|
import "what-input";
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
||||||
import "focus-visible"; // to fix context menus
|
|
||||||
import { mocked } from "jest-mock";
|
import { mocked } from "jest-mock";
|
||||||
import {
|
import {
|
||||||
MatrixClient,
|
MatrixClient,
|
||||||
|
|
|
@ -359,8 +359,7 @@ exports[`<MatrixChat /> with an existing session onAction() room actions leave_r
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mx_Dialog_primary focus-visible"
|
class="mx_Dialog_primary"
|
||||||
data-focus-visible-added=""
|
|
||||||
data-testid="dialog-primary-button"
|
data-testid="dialog-primary-button"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
@ -416,8 +415,7 @@ exports[`<MatrixChat /> with an existing session onAction() room actions leave_r
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mx_Dialog_primary focus-visible"
|
class="mx_Dialog_primary"
|
||||||
data-focus-visible-added=""
|
|
||||||
data-testid="dialog-primary-button"
|
data-testid="dialog-primary-button"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
|
|
|
@ -49,8 +49,7 @@ exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly
|
||||||
exports[`ThreadPanel Header expect that ThreadPanelHeader has the correct option selected in the context menu 1`] = `
|
exports[`ThreadPanel Header expect that ThreadPanelHeader has the correct option selected in the context menu 1`] = `
|
||||||
<div
|
<div
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
class="mx_AccessibleButton mx_ThreadPanel_Header_FilterOptionItem focus-visible"
|
class="mx_AccessibleButton mx_ThreadPanel_Header_FilterOptionItem"
|
||||||
data-focus-visible-added=""
|
|
||||||
role="menuitemradio"
|
role="menuitemradio"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
|
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
|
||||||
import { Mocked, mocked } from "jest-mock";
|
import { Mocked, mocked } from "jest-mock";
|
||||||
import "focus-visible"; // to fix context menus
|
|
||||||
import { prettyDOM, render, RenderResult, screen } from "@testing-library/react";
|
import { prettyDOM, render, RenderResult, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,7 @@ exports[`<SpaceContextMenu /> renders menu correctly 1`] = `
|
||||||
[36m>[39m
|
[36m>[39m
|
||||||
[36m<li[39m
|
[36m<li[39m
|
||||||
[33maria-label[39m=[32m"Space home"[39m
|
[33maria-label[39m=[32m"Space home"[39m
|
||||||
[33mclass[39m=[32m"mx_AccessibleButton mx_IconizedContextMenu_item focus-visible"[39m
|
[33mclass[39m=[32m"mx_AccessibleButton mx_IconizedContextMenu_item"[39m
|
||||||
[33mdata-focus-visible-added[39m=[32m""[39m
|
|
||||||
[33mrole[39m=[32m"menuitem"[39m
|
[33mrole[39m=[32m"menuitem"[39m
|
||||||
[33mtabindex[39m=[32m"0"[39m
|
[33mtabindex[39m=[32m"0"[39m
|
||||||
[36m>[39m
|
[36m>[39m
|
||||||
|
|
|
@ -5670,11 +5670,6 @@ focus-lock@^0.11.6:
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.0.3"
|
tslib "^2.0.3"
|
||||||
|
|
||||||
focus-visible@^5.2.0:
|
|
||||||
version "5.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/focus-visible/-/focus-visible-5.2.0.tgz#3a9e41fccf587bd25dcc2ef045508284f0a4d6b3"
|
|
||||||
integrity sha512-Rwix9pBtC1Nuy5wysTmKy+UjbDJpIfg8eHjw0rjZ1mX4GNLz1Bmd16uDpI3Gk1i70Fgcs8Csg2lPm8HULFg9DQ==
|
|
||||||
|
|
||||||
follow-redirects@^1.15.0:
|
follow-redirects@^1.15.0:
|
||||||
version "1.15.3"
|
version "1.15.3"
|
||||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
|
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
|
||||||
|
|
Loading…
Reference in a new issue