0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Android Chrome の タップして検索 (Touch to Search) の対象から外す

Last updated at Posted at 2025-03-29

はじめに

  • Android Chrome には 「タップして検索」という機能が存在する
  • 特定の要素をタップや、長押しをしたときに「タップして検索」の対象から除外したい

回避方法

  • 要素に tabindex=-1 を付与する
  • 要素がインタラクティブであることを示す
    • role=button や JavaScript を使用して DOM を操作する
  • 要素に user-select: none を付与する

その中の「要素に user-select: none を付与する」について記載する

要素に user-select: none を付与する

Tailwind CSS を使用している場合

Class に select-none を追加すれば良い。

<span class"select-none">foo</span>

CSS の場合

user-select: none; を指定してあげれば良い。

.foo {
  user-select: none;
}
<span class="foo">bar</span>

Ref

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?