PreviewTrigger: option to open on press (tap) instead of long press on touch devices
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start with the PreviewTrigger component and its long-press handling, then read how the hover, focus and press events open the popover. The issue leaves the API open (a touchTrigger prop or an openOnPress boolean, or a configurable long-press delay), so a maintainer must choose one before coding. Done means a tap toggles the popover with the option on, long press stays the default, and tests cover mouse, keyboard and touch. Read #8905 and #10243 for the earlier decisions.
索引モデルが issue の本文から書いたものです。
説明
Provide a general summary of the feature here
Add an option to PreviewTrigger so a regular press (a tap on touch devices) opens the preview. Today a touch user has to long press. The option is for triggers whose only job is to show the popover, such as an info button, rather than links.
🤔 Expected Behavior?
With the option on (for example <PreviewTrigger openOnPress> or touchTrigger="press"):
- Mouse: hover opens after the usual delay, as now. Clicking the trigger also toggles the popover.
- Keyboard: focus opens it, as now. Enter or Space toggles it.
- Touch: a tap toggles the popover. Pressing outside or Escape closes it, as with any non-modal popover.
Long press stays the default, so link previews keep working as they do today.
😯 Current Behavior
PreviewTrigger opens on hover, on focus and on long press. A tap runs the trigger's own action (onPress, or navigation for a Link).
That's right for link previews. But when the trigger's only purpose is to reveal the popover (an info icon next to a field label or table header, for example), touch users have to discover a long press. Tooltip isn't an alternative, because it isn't shown on touch at all, and it can't contain interactive content anyway.
The workaround is to combine useHover with a controlled DialogTrigger/Popover. That means re-implementing the warmup and cooldown delays, the safe-area polygon and the focus behaviour that PreviewTrigger already handles.
💁 Possible Solution
Either of these would work for us:
- Open on press. Add a prop that sets how touch users open the preview, for example
touchTrigger?: 'longPress' | 'press'(default'longPress'), or a booleanopenOnPressthat makes a press on any pointer type toggle the popover. - Configurable long-press threshold. If it fits the current implementation better, expose the long-press delay as a prop. Setting it to
0for these triggers would give the same result as option 1.
Prior art: Base UI's Popover.Trigger has an openOnHover prop (https://base-ui.com/react/components/popover). Hover is mouse-only and click or tap always opens it, so the same trigger works on hover with a mouse and on tap with touch. This was mentioned in #8905, which PreviewTrigger (#10243) closed.
🔦 Context
We're building a design system on React Aria Components for a mature data product. A common pattern is a small "info" trigger next to labels and column headers. It opens a non-modal popover with a short explanation and sometimes a link. On desktop it should open on hover. On touch it needs to open on tap, because a long press on a plain icon button isn't discoverable.
PreviewTrigger is very close to what we need. It's only the touch gesture that rules it out for this pattern.
💻 Examples
<PreviewTrigger touchTrigger="press">
<Button aria-label="About this field">
<InfoIcon />
</Button>
<Popover>
<Dialog>
Rows are sampled from the last 7 days. <Link href="/docs/sampling">Learn more</Link>
</Dialog>
</Popover>
</PreviewTrigger>
- 主要言語
- TypeScript
- スター
- 16k
- フォーク
- 1.6k
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 39
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adobe/react-spectrum のほかの issue
-
@internationalized/number: NumberParser misparses Arabic-digit numbers that use . , or ، (sd parses ١٬٢٣٤.٥ as 12345)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
adobe/react-spectrum#10936 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
PreviewTrigger: the preview dialog has no accessible name対応中かも @therealemmanueloppong が 2 日前に担当しました。 オープンaccessibility bug PreviewTrigger
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
adobe/react-spectrum#10917 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unit対応中かも @darshpatel1052 が 5 日前に担当しました。 オープンwaiting on author
難易度 2/5 1時間未満 初心者へのやさしさ 88/100
adobe/react-spectrum#10909 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValue対応中かも @mrlexcoder が 5 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
adobe/react-spectrum#10900 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Separator adds a redundant role="separator" to its default <hr>対応中かも @Janani-bn が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
adobe/react-spectrum#10894 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
adobe/react-spectrum の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
earendil-works/pi-claude-code#36 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Resources: New work of jabodetabek対応中かも @rmt-svc が今日担当しました。 オープンresources
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
railmapgen/rmp-gallery#4167 ·
メンテナーはふだん 2 日以内に返信
-
documentation p1
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
microsoft/monaco-editor#5577 ·
メンテナーはふだん 1 日以内に返信