Skip to content
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

Embedding posts and scrolling on their own #15281

Closed
osapon opened this issue Dec 6, 2020 · 6 comments · Fixed by #22778
Closed

Embedding posts and scrolling on their own #15281

osapon opened this issue Dec 6, 2020 · 6 comments · Fixed by #22778
Labels
bug Something isn't working

Comments

@osapon
Copy link

osapon commented Dec 6, 2020

Expected behaviour

I don't want they to scroll.

Actual behaviour

I embed a video post with audio, it seems to automatically scroll to the embedding location when the page is viewed.
Doesn't happen with images or videos that have no sound.

Steps to reproduce the problem

These are no problem.
https://diary.osa-p.net/2020/11/blog-post.html
https://diary.osa-p.net/2020/11/mastodon-issue-2.html
https://diary.osa-p.net/2020/11/mastodon-issue-3.html

This is a phenomenon that occurs.
https://diary.osa-p.net/2020/11/mastodon-issue-4.html

Specifications

Mastodon v3.2.0
Chrome 87.0.4280.88
Firefox 84.0b8
Checked at.

@osapon osapon added the bug Something isn't working label Dec 6, 2020
@Akkiesoft
Copy link
Contributor

Akkiesoft commented Dec 6, 2020

I have same problem.

https://akkiesoft.hatenablog.jp/entry/20201205/1607096581

Specifications

Mastodon v3.1.4
Chrome 87.0.4280.88@Mac

2020/12/8 added

  • reproduce: Firefox 81.0.2@Mac, 83.0@Mac
  • Not reproduce: Safari(14.0.1)

@Akkiesoft
Copy link
Contributor

There is still a problem...

I was create test page for this issue:
https://akkiesoft.github.io/mastodon-issue-15281/

Here is the capture. I was tested on Mastodon v3.4.3 /Chrome 96.0.4664.110@Mac.

2022-01-04.11.57.01.mp4

@MitarashiDango
Copy link
Contributor

This issue seems to be caused by calling the HTMLElement.focus() method inside React by setting the autoFocus attribute of the play button implemented in the video player to true.

<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>

Also, for posts embedded in other websites, I think you need not to focus on the play button.
Therefore, I think it is necessary to process to determine whether the post is embedded.

@Akkiesoft
Copy link
Contributor

This problem remains in Mastodon 4.0.0.

https://akkiesoft.github.io/mastodon-issue-15281/test-maud-io.html

@Akkiesoft
Copy link
Contributor

I built my own Mastodon server.

Then I deleted autoFocus and run server, the problem has been resolved and no other differences in behavior from the original can be found.

https://akkiesoft.github.io/mastodon-issue-15281/test-mugiko-moe.html

@Akkiesoft
Copy link
Contributor

@ClearlyClaire added autoFocus in #12498.

I seem to this attribute inserts when a status embedded but causes this problem.
So I think autoFocus don't need in embedded status.

How about ?

Akkiesoft added a commit to Akkiesoft/mastodon that referenced this issue Jan 6, 2023
* add variable autoFocus to video
* set autoFocus in video_modal.js
Gargron pushed a commit that referenced this issue Jan 9, 2023
* add variable autoFocus to video
* set autoFocus in video_modal.js
nametoolong pushed a commit to nametoolong/nuage that referenced this issue Jan 12, 2023
* add variable autoFocus to video
* set autoFocus in video_modal.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants