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?

More than 3 years have passed since last update.

safari : <input type="file">でバグるときの対応

Last updated at Posted at 2020-12-15

titleの通り。

202021216追記
既存のバグらしい。
https://discussionsjapan.apple.com/thread/252057820

環境

  • Mac OS Mojave 10.14.6
  • Safari : バージョン14.0.1 (14610.2.11.51.10)

結論

acceptを書いたらうまく行った

問題のコード

ざっくりと以下の通り。


<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>Document</title>
</head>

<body>
	<!-- ↓このinputが動かん -->
	<p>test1Input</p>
	<input type="file" id="hoge" name="fuga" />
	<br />

	<!-- ↓こっちは動く -->
	<p>test2Input</p>
	<input
      type="file"
      id="avatar"
      name="avatar"
      accept="image/png, image/jpeg"
    />
	<br />
  </body>
</html>

具体的な問題

  • 2個めinputをクリックすると正常に起動。
  • その後、1個めのinputをクリックすると無反応。
  • 1個めをクリックしたあとだと、2個めも動かなくなる。
  • safariを再起動すると治る。

参考
stackoverflow大先生

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?