[Glitch] Accessibility: Ensure focus order of post elements matches visual reading order
Port d20d04922672ed016029c40ed64798f341ebca91 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
3e25a5e792
commit
08dc44263d
@ -713,13 +713,14 @@ class Status extends ImmutablePureComponent {
|
|||||||
account={account}
|
account={account}
|
||||||
avatarSize={avatarSize}
|
avatarSize={avatarSize}
|
||||||
onHeaderClick={this.handleHeaderClick}
|
onHeaderClick={this.handleHeaderClick}
|
||||||
>
|
contentBeforeDate={
|
||||||
<StatusIcons
|
<StatusIcons
|
||||||
status={status}
|
status={status}
|
||||||
mediaIcons={mediaIcons}
|
mediaIcons={mediaIcons}
|
||||||
settings={settings.get('status_icons')}
|
settings={settings.get('status_icons')}
|
||||||
/>
|
/>
|
||||||
</StatusHeader>
|
}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -18,7 +18,8 @@ export interface StatusHeaderProps {
|
|||||||
status: Status;
|
status: Status;
|
||||||
account?: Account;
|
account?: Account;
|
||||||
avatarSize?: number;
|
avatarSize?: number;
|
||||||
children?: ReactNode;
|
contentBeforeDate?: ReactNode;
|
||||||
|
contentAfterDate?: ReactNode;
|
||||||
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
||||||
displayNameProps?: DisplayNameProps;
|
displayNameProps?: DisplayNameProps;
|
||||||
onHeaderClick?: MouseEventHandler<HTMLDivElement>;
|
onHeaderClick?: MouseEventHandler<HTMLDivElement>;
|
||||||
@ -31,10 +32,11 @@ export type StatusHeaderRenderFn = (args: StatusHeaderProps) => ReactNode;
|
|||||||
export const StatusHeader: FC<StatusHeaderProps> = ({
|
export const StatusHeader: FC<StatusHeaderProps> = ({
|
||||||
status,
|
status,
|
||||||
account,
|
account,
|
||||||
children,
|
|
||||||
className,
|
className,
|
||||||
avatarSize = 48,
|
avatarSize = 48,
|
||||||
wrapperProps,
|
wrapperProps,
|
||||||
|
contentBeforeDate,
|
||||||
|
contentAfterDate,
|
||||||
onHeaderClick,
|
onHeaderClick,
|
||||||
}) => {
|
}) => {
|
||||||
const statusAccount = status.get('account') as Account | undefined;
|
const statusAccount = status.get('account') as Account | undefined;
|
||||||
@ -54,7 +56,8 @@ export const StatusHeader: FC<StatusHeaderProps> = ({
|
|||||||
avatarSize={avatarSize}
|
avatarSize={avatarSize}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{children}
|
{contentBeforeDate}
|
||||||
|
{contentAfterDate}
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -226,17 +226,20 @@ export const QuotedStatus: React.FC<QuotedStatusProps> = ({
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const headerRenderFn: StatusHeaderRenderFn = useCallback(
|
const headerRenderFn: StatusHeaderRenderFn = useCallback(
|
||||||
(props) => (
|
(props) => (
|
||||||
<StatusHeader {...props}>
|
<StatusHeader
|
||||||
{onQuoteCancel && (
|
{...props}
|
||||||
<IconButton
|
contentAfterDate={
|
||||||
onClick={onQuoteCancel}
|
onQuoteCancel && (
|
||||||
className='status__quote-cancel'
|
<IconButton
|
||||||
title={intl.formatMessage(quoteCancelMessage)}
|
onClick={onQuoteCancel}
|
||||||
icon='cancel-fill'
|
className='status__quote-cancel'
|
||||||
iconComponent={CancelFillIcon}
|
title={intl.formatMessage(quoteCancelMessage)}
|
||||||
/>
|
icon='cancel-fill'
|
||||||
)}
|
iconComponent={CancelFillIcon}
|
||||||
</StatusHeader>
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
[intl, onQuoteCancel],
|
[intl, onQuoteCancel],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -22,18 +22,22 @@ export const renderPinnedStatusHeader: StatusHeaderRenderFn = ({
|
|||||||
return <StatusHeader {...args} />;
|
return <StatusHeader {...args} />;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<StatusHeader {...args} className={classes.pinnedStatusHeader}>
|
<StatusHeader
|
||||||
<Badge
|
{...args}
|
||||||
className={classes.pinnedBadge}
|
className={classes.pinnedStatusHeader}
|
||||||
icon={<Icon id='pinned' icon={IconPinned} />}
|
contentBeforeDate={
|
||||||
label={
|
<Badge
|
||||||
<FormattedMessage
|
className={classes.pinnedBadge}
|
||||||
id='account.timeline.pinned'
|
icon={<Icon id='pinned' icon={IconPinned} />}
|
||||||
defaultMessage='Pinned'
|
label={
|
||||||
/>
|
<FormattedMessage
|
||||||
}
|
id='account.timeline.pinned'
|
||||||
/>
|
defaultMessage='Pinned'
|
||||||
</StatusHeader>
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -126,4 +126,7 @@
|
|||||||
|
|
||||||
.pinnedBadge {
|
.pinnedBadge {
|
||||||
justify-self: end;
|
justify-self: end;
|
||||||
|
|
||||||
|
// Allow "click to open post" event to pass through
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1716,7 +1716,6 @@ body > [data-popper-placement] {
|
|||||||
|
|
||||||
.status__quote-cancel {
|
.status__quote-cancel {
|
||||||
align-self: self-start;
|
align-self: self-start;
|
||||||
order: 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.status__info {
|
.status__info {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user