mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 00:22:42 +00:00
fix: Prevent click on content warning banner in notification from opening the post (#35096)
This commit is contained in:
parent
102a7635d6
commit
08597a1819
|
@ -8,6 +8,10 @@ export enum BannerVariant {
|
|||
Filter = 'filter',
|
||||
}
|
||||
|
||||
const stopPropagation: MouseEventHandler = (e) => {
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
export const StatusBanner: React.FC<{
|
||||
children: React.ReactNode;
|
||||
variant: BannerVariant;
|
||||
|
@ -38,6 +42,7 @@ export const StatusBanner: React.FC<{
|
|||
: 'content-warning content-warning--filter'
|
||||
}
|
||||
onClick={forwardClick}
|
||||
onMouseUp={stopPropagation}
|
||||
>
|
||||
<p id={descriptionId}>{children}</p>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user