Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AppScreen's height calculated as 0 when used with Radix UI Dropdown Menu

オープン
#570 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
css, react, typescript
領域
frontend

調査の方向性

StackBlitz の再現から始め、position と height を設定している AppScreen のスタイルを特定します。Radix UI の Dropdown Menu を開いて問題を再現し、メニューが document.body のスタイルを変更したときに AppScreen が表示されたままで、意図した viewport の高さを維持することを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description

When using Radix UI's Dropdown Menu inside the AppScreen component of stackflow, the AppScreen component's height is calculated as 0, causing it to become invisible.

Issue Reproduction

https://stackblitz.com/edit/stackflow-with-radix-ui-dropdown?file=src%2FMyAcitivity.tsx

Possible Causes

This issue seems to be related to the react-remove-scroll-bar library used internally by the Radix UI Dropdown Menu. When the dropdown opens, it adds position: relative to the document.body.

  body[${lockAttribute}] {
    ...
    ${[
      allowRelative && `position: relative ${important};`,
      ...
    ]
      .filter(Boolean)
      .join('')}
  }

Since the AppScreen component has position: absolute and height: 100% styles, its height is calculated relative to the body (now position: relative), resulting in height of 0.

Suggested Solution

If the reason for using height: 100% is to set the height relative to the Initial Containing Block (ViewPort), assuming there's no positioned ancestor for AppScreen component, then replacing height: 100% with height: 100vh might solve the problem.

If dynamic changes to vh (due to address bars on mobile browsers) are a concern, using newer CSS units like lvh, svh, or dvh could be a suitable alternative. (https://stackoverflow.com/a/72245072/4773272)

主要言語
TypeScript
スター
1k
フォーク
113
平均マージ
1時間 45分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

daangn/stackflow のほかの issue

daangn/stackflow の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。