Click-away (close on outside click) does not work in ShadowDom for action "click"
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
trigger パッケージの inPopupOrChild ロジックから始め、リンクされた CodeSandbox を Shadow DOM 内で使用して動作を再現します。mousedown イベントと click イベントがどのように retarget されるかを追跡し、popover の外側をクリックすると閉じる一方で、trigger または popover のコンテンツをクリックしても閉じないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
When using the popover from Antd in a WebComponent with the "click" action the "click away" does not work, the popover is never closed. When clicking on the trigger button the popover is closed.
<Popover content={<div>demo</div>} title="Title" trigger="click">
<Button>Click me</Button>
</Popover>
Expected:
Clicking on anything other than the popover content or the trigger (button in this case) the popover should close.
Actuall:
The popover is not closed.
Findings:
When using a popover from Antd inside a ShadoDom and using the trigger "click" the inPopupOrChild incorrectly thinks the mousedown/click is inside the content. There is something wrong in the checking of inPopupOrChild. The event retargeting makes the event come from the webcomponent and somehow the trigger thinks this is inside the content.
Workaround:
Catch the onMouseDown event in the webcomponent ctor and stop the bubbling with stopPropagation stops the event from reaching the global listener a second time.
- 主要言語
- TypeScript
- スター
- 391
- フォーク
- 245
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react-component/trigger のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
react-component/trigger#593 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
react-component/trigger#623 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
react-component/trigger#618 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
react-component/trigger#555 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
react-component/trigger#550 · コメント 1 件 ·
react-component/trigger の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·