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

Improve: スムーススクロール後にフォーカスを移動する #285

Closed
manabuyasuda opened this issue Dec 24, 2019 · 0 comments
Closed
Labels
enhancement 機能の追加や改修。機能を実装したらクローズする。
Projects

Comments

@manabuyasuda
Copy link
Owner

manabuyasuda commented Dec 24, 2019

スムーススクロール後にフォーカスが移動元のままになっている。
以下のように、移動先の要素にフォーカスを移動させる。

    // スクロール先要素にフォーカスを変更する
    after(offset, $trigger, scrollElement) {
      const destination = document.getElementById(scrollElement.ctx.hash.replace('#', ''));
      destination.setAttribute('tabindex', '-1');
      destination.focus();
    },
    // body要素にフォーカスを変更する
    after() {
      const destination = document.getElementsByTagName('body')[0];
      destination.setAttribute('tabindex', '-1');
      destination.focus();
    },
@manabuyasuda manabuyasuda added the enhancement 機能の追加や改修。機能を実装したらクローズする。 label Dec 24, 2019
@manabuyasuda manabuyasuda added this to To do in v4 via automation Dec 24, 2019
manabuyasuda added a commit that referenced this issue Apr 8, 2020
Improve: スムーススクロール後にフォーカスを移動する
v4 automation moved this from To do to Done Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 機能の追加や改修。機能を実装したらクローズする。
Projects
v4
  
Done
Development

No branches or pull requests

1 participant