-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add variable autoFocus to video #22778
Conversation
Note that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue occurs because embeds use detailed: true
in app/views/statuses/_detailed_status.html.haml
. It would make sense to me to decouple the autofocus from the detailed
behavior. It would also make sense to use detailed
in app/javascript/mastodon/features/status/components/detailed_status.js
but that is another issue.
@@ -617,7 +617,7 @@ class Video extends React.PureComponent { | |||
|
|||
<div className='video-player__buttons-bar'> | |||
<div className='video-player__buttons left'> | |||
<button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} className='player-button' onClick={this.togglePlay} autoFocus={detailed}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button> | |||
<button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} className='player-button' onClick={this.togglePlay}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing it altogether, I would add an autoFocus
prop that app/javascript/mastodon/features/ui/components/video_modal.js
would make use of in addition to detailed
.
* add variable autoFocus to video * set autoFocus in video_modal.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you for your contribution!
* add variable autoFocus to video * set autoFocus in video_modal.js
Fixes #15281.