11
5

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 5 years have passed since last update.

react-modalのスクロール問題の解決

Posted at

react-modalで作られた画面の後ろの画面がスクロールされてしまう問題の解決方法をメモします。

modalが表示されたbody部に追加されるクラス「ReactModal__Body--open」のCSS設定を記載することで、後ろ画面のスクロールを禁止します。

.ReactModal__Body--open {
  position: fixed;
}

参考記事

Don't scroll parent component when Modal is opened

11
5
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?