From e98b54d311b190fd713e8214802a1c23b768a6c2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 18 Oct 2024 11:47:59 +0100 Subject: [PATCH] Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- playwright/e2e/register/register.spec.ts | 6 +++--- res/css/views/rooms/_EventTile.pcss | 2 -- src/components/structures/ContextMenu.tsx | 1 - src/components/views/elements/Field.tsx | 4 ++-- src/components/views/elements/MiniAvatarUploader.tsx | 2 +- src/components/views/elements/Validation.tsx | 2 +- src/components/views/messages/TextualBody.tsx | 4 +--- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/playwright/e2e/register/register.spec.ts b/playwright/e2e/register/register.spec.ts index 8ea64f8a657..2dd3779573d 100644 --- a/playwright/e2e/register/register.spec.ts +++ b/playwright/e2e/register/register.spec.ts @@ -96,7 +96,7 @@ test.describe("Registration", () => { }); }); await page.getByRole("textbox", { name: "Username", exact: true }).fill("_alice"); - await expect(page.getByRole("alert").filter({ hasText: "Some characters not allowed" })).toBeVisible(); + await expect(page.getByRole("tooltip").filter({ hasText: "Some characters not allowed" })).toBeVisible(); await page.route("**/_matrix/client/*/register/available?username=bob", async (route) => { await route.fulfill({ @@ -108,9 +108,9 @@ test.describe("Registration", () => { }); }); await page.getByRole("textbox", { name: "Username", exact: true }).fill("bob"); - await expect(page.getByRole("alert").filter({ hasText: "Someone already has that username" })).toBeVisible(); + await expect(page.getByRole("tooltip").filter({ hasText: "Someone already has that username" })).toBeVisible(); await page.getByRole("textbox", { name: "Username", exact: true }).fill("foobar"); - await expect(page.getByRole("alert")).not.toBeVisible(); + await expect(page.getByRole("tooltip")).not.toBeVisible(); }); }); diff --git a/res/css/views/rooms/_EventTile.pcss b/res/css/views/rooms/_EventTile.pcss index ab6397f3e1e..92e4cf78eaf 100644 --- a/res/css/views/rooms/_EventTile.pcss +++ b/res/css/views/rooms/_EventTile.pcss @@ -878,8 +878,6 @@ $left-gutter: 64px; } .mx_EventTile_body { - width: 100%; - a:hover { text-decoration: underline; } diff --git a/src/components/structures/ContextMenu.tsx b/src/components/structures/ContextMenu.tsx index 0abd715d8db..2c7a864db5d 100644 --- a/src/components/structures/ContextMenu.tsx +++ b/src/components/structures/ContextMenu.tsx @@ -12,7 +12,6 @@ import React, { CSSProperties, RefObject, SyntheticEvent, useRef, useState } fro import ReactDOM from "react-dom"; import classNames from "classnames"; import FocusLock from "react-focus-lock"; -import { TooltipProvider } from "@vector-im/compound-web"; import { Writeable } from "../../@types/common"; import UIStore from "../../stores/UIStore"; diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 9049d2b582b..540cf37cbef 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -56,7 +56,7 @@ interface IProps { forceValidity?: boolean; // If specified, contents will appear as a tooltip on the element and // validation feedback tooltips will be suppressed. - tooltipContent?: JSX.Element; + tooltipContent?: JSX.Element | string; // If specified the tooltip will be shown regardless of feedback forceTooltipVisible?: boolean; // If specified, the tooltip with be aligned accorindly with the field, defaults to Right. @@ -111,7 +111,7 @@ type PropShapes = IInputProps | ISelectProps | ITextareaProps | INativeOnChangeI interface IState { valid?: boolean; - feedback?: JSX.Element; + feedback?: JSX.Element | string; feedbackVisible: boolean; focused: boolean; } diff --git a/src/components/views/elements/MiniAvatarUploader.tsx b/src/components/views/elements/MiniAvatarUploader.tsx index 952cc98a2f8..8bbca5b309b 100644 --- a/src/components/views/elements/MiniAvatarUploader.tsx +++ b/src/components/views/elements/MiniAvatarUploader.tsx @@ -82,7 +82,7 @@ const MiniAvatarUploader: React.FC = ({ accept="image/*" /> - + { private readonly contentRef = createRef(); - private unmounted = false; private pills: Element[] = []; private tooltips: Element[] = []; private reactRoots: Element[] = []; @@ -131,7 +130,6 @@ export default class TextualBody extends React.Component { } public componentWillUnmount(): void { - this.unmounted = true; unmountPills(this.pills); unmountTooltips(this.tooltips);