Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 765a715

Browse files
authored
Remove duplicate tooltip from user pills (#8512)
* Remove duplicate tooltip from user pills * Fix test
1 parent 99543a7 commit 765a715

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/components/views/elements/Pill.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export default class Pill extends React.Component<IProps, IState> {
225225
member.rawDisplayName = member.rawDisplayName || '';
226226
linkText = member.rawDisplayName;
227227
if (this.props.shouldShowPillAvatar) {
228-
avatar = <MemberAvatar member={member} width={16} height={16} aria-hidden="true" />;
228+
avatar = <MemberAvatar member={member} width={16} height={16} aria-hidden="true" hideTitle />;
229229
}
230230
pillClass = 'mx_UserPill';
231231
href = null;

src/utils/WidgetUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { MatrixClientPeg } from '../MatrixClientPeg';
2929
import SdkConfig from "../SdkConfig";
3030
import dis from '../dispatcher/dispatcher';
3131
import WidgetEchoStore from '../stores/WidgetEchoStore';
32-
import SettingsStore from "../settings/SettingsStore";
3332
import { IntegrationManagers } from "../integrations/IntegrationManagers";
3433
import { WidgetType } from "../widgets/WidgetType";
3534
import { Jitsi } from "../widgets/Jitsi";

test/components/views/messages/TextualBody-test.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,7 @@ describe("<TextualBody />", () => {
254254
const wrapper = getComponent({ mxEvent: ev }, matrixClient);
255255
expect(wrapper.text()).toBe("Hey Member");
256256
const content = wrapper.find(".mx_EventTile_body");
257-
expect(content.html()).toBe('<span class="mx_EventTile_body markdown-body" dir="auto">' +
258-
'Hey <span>' +
259-
'<a class="mx_Pill mx_UserPill">' +
260-
'<img class="mx_BaseAvatar mx_BaseAvatar_image" src="mxc://avatar.url/image.png" ' +
261-
'style="width: 16px; height: 16px;" title="@member:domain.bla" alt="" aria-hidden="true">Member</a>' +
262-
'</span></span>');
257+
expect(content.html()).toMatchSnapshot();
263258
});
264259

265260
it("pills do not appear in code blocks", () => {

test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ exports[`<TextualBody /> renders formatted m.text correctly pills do not appear
1313
</code><span></span></pre><span class=\\"mx_EventTile_button mx_EventTile_copyButton \\"></span></div>
1414
</span>"
1515
`;
16+
17+
exports[`<TextualBody /> renders formatted m.text correctly pills get injected correctly into the DOM 1`] = `"<span class=\\"mx_EventTile_body markdown-body\\" dir=\\"auto\\">Hey <span><a class=\\"mx_Pill mx_UserPill\\"><img class=\\"mx_BaseAvatar mx_BaseAvatar_image\\" src=\\"mxc://avatar.url/image.png\\" style=\\"width: 16px; height: 16px;\\" alt=\\"\\" aria-hidden=\\"true\\">Member</a></span></span>"`;

0 commit comments

Comments
 (0)