`Tooltip` is incompatible with callback refs
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start at the Tooltip component's ref handling and reproduce the callback-ref example from the issue, comparing it with the object-ref case. Done means a callback ref passed to Tooltip still receives the underlying element and the tooltip appears when hovering the wrapped Button.
索引モデルが issue の本文から書いたものです。
説明
Description
When I encountered https://github.com/primer/react/issues/8373 I moved my callback ref to the wrapping Tooltip . This appeared to forward the ref to the underlying element as I wanted. However, if the passed ref is a callback ref, the tooltip never appears. This is not the case for an object ref.
Steps to reproduce
This breaks, even though it typechecks just fine. The log does get called, but the tooltip does not appear:
const logRef = useCallback(element => console.log(element), [])
return <Tooltip ref={logRef} text="Example"><Button>Button text</Button></Tooltip>
This works, but isn't a callback ref:
const logRef = useRef(null)
return <Tooltip ref={logRef} text="Example"><Button>Button text</Button></Tooltip>
And this shows the tooltip but never calls the log (#8373):
const logRef = useCallback(element => console.log(element), [])
return <Tooltip text="Example"><Button ref={logRef}>Button text</Button></Tooltip>
Version
v38.37.0
Browser
No response
- 主要言語
- TypeScript
- スター
- 3.9k
- フォーク
- 697
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 51
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
primer/react のほかの issue
-
PageHeader.Title does not seem to accept id prop対応中かも @TylerJDev が 3 日前に担当しました。 オープンcomponent: PageHeader react staff
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
primer/react#8474 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
The padding prop seems to have no effect with PageLayout.Sidebar対応中かも @minwookshin が 15 日前に担当しました。 オープンcomponent: PageLayout react staff
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
primer/react#8470 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug component: Spinner react
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
primer/react#8423 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
waiting for author response
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
primer/react#8172 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Checkbox: replace useLayoutEffect with ref callback for indeterminate prop再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンcomponent: Checkbox react
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
documentation good first issue
難易度 2/5 半日 初心者へのやさしさ 72/100
sujithputta02/Esapay#13 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ehmpathy/rhachet-roles-bhuild#468 ·
メンテナーはふだん 1 日以内に返信
-
Share dialog: the address book's contact count reads "1 contacts" (no singular form in any language)対応中かも @chibenwa が今日担当しました。 オープンai-driven-qa bug claude Cosmetic
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
linagora/twake-contacts-frontend#271 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Koenkk/zigbee2mqtt#33402 ·
メンテナーはふだん 1 日以内に返信