Add ability to dismiss alt text badge by tapping it in web UI (#33737)
This commit is contained in:
parent
2d545c5fe5
commit
796187c1e8
4 changed files with 81 additions and 5 deletions
|
@ -6,6 +6,7 @@ import classNames from 'classnames';
|
|||
|
||||
import Overlay from 'react-overlays/Overlay';
|
||||
|
||||
import { useSelectableClick } from '@/hooks/useSelectableClick';
|
||||
import QuestionMarkIcon from '@/material-icons/400-24px/question_mark.svg?react';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
|
||||
|
@ -23,6 +24,8 @@ export const InfoButton: React.FC = () => {
|
|||
setOpen(!open);
|
||||
}, [open, setOpen]);
|
||||
|
||||
const [handleMouseDown, handleMouseUp] = useSelectableClick(handleClick);
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
|
@ -46,10 +49,13 @@ export const InfoButton: React.FC = () => {
|
|||
target={triggerRef}
|
||||
>
|
||||
{({ props }) => (
|
||||
<div
|
||||
<div // eslint-disable-line jsx-a11y/no-noninteractive-element-interactions
|
||||
{...props}
|
||||
className='dialog-modal__popout prose dropdown-animation'
|
||||
role='region'
|
||||
id={accessibilityId}
|
||||
onMouseDown={handleMouseDown}
|
||||
onMouseUp={handleMouseUp}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='info_button.what_is_alt_text'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue