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

Mobile only: Button is not pressable if I change color from `undefined` to value and back at `onPointerUp` event

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

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

評価

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

調査の方向性

まず、RSD 0.0.47 を使ってモバイルで提供された UnstyledButton の例を再現し、onPointerUp 中にアクティブな色の値が undefined に戻る遷移に焦点を当てます。pointer-event と style-update の経路を追跡します。アクティブなスタイルが削除された後に onClick が確実に発火すれば完了です。

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

説明

bug
Describe the issue

Our component manages button active style internally like on example below.
When onPointerUp callback is fired the style with the color property is removed from button element.
It somehow result in onClick callback not working.

https://github.com/user-attachments/assets/17810d7c-68ed-4d41-b16b-d3c739065c46

Expected behavior

onClick works as expected despite the change of styles

Steps to reproduce

RSD 0.0.47, the issue reproduces only on mobile.

const UnstyledButton = () => {
  const [isActive, setActive] = React.useState(false);

  return (
    <h.button
      style={isActive && styles.active}
      type="button"
      role="button"
      onClick={() => alert('!')}
      onPointerDown={() => setActive(true)}
      onPointerUp={() => setActive(false)}
      onPointerOut={() => setActive(false)}
      onPointerCancel={() => setActive(false)}
      onKeyDown={({ key }) => {
        if (key === "Enter" || key === " " || key === "Space") {
          setActive(true);
        }
      }}
      onKeyUp={() => setActive(false)}
      {...props}
    >
      Test Button
    </h.button>
  );
};
UnstyledButton.displayName = "UnstyledButton";

const styles = css.create({
  active: {
    color: '#0f0',
  },
});
主要言語
JavaScript
スター
3.6k
フォーク
208
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

react/react-strict-dom のほかの issue

react/react-strict-dom の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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