In 'HTMLElement.classList.toggle' the 'force' attribute works uncorrectly.
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- web-dev
調査の方向性
HTMLElement.classList.toggle の実装を特定し、省略された force 引数の処理を、ここで説明されているブラウザーの動作と比較してください。undefined が省略された引数として扱われる一方で、明示的な boolean 値が引き続き結果を制御することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
export const toggle = <T extends HTMLElement> (className:string, force?:boolean) => (el:T) : boolean => el.classList.toggle(className, force)
toggle(className)(el)
In this example, if the 'force' attribute is not passed to the 'toggle' function, 'linkedom' will interpret it as being passed an attribute equal to 'undefined' and identify it as a 'false' value.
The correct way is for 'linkedom' to ignore the 'force' attribute if it is 'undefined'.
Everything works fine in the browser.
Аnd also in 'linkedom' everything works correctly if I do this check myself:
export const toggle = <T extends HTMLElement> (className:string, force?:boolean) => (el:T) : boolean => force === undefined ? el.classList.toggle(className) : el.classList.toggle(className, force)
- 主要言語
- HTML
- スター
- 2.1k
- フォーク
- 104
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebReflection/linkedom のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
WebReflection/linkedom#329 · コメント 5 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
WebReflection/linkedom#327 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
WebReflection/linkedom#326 · コメント 5 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
WebReflection/linkedom#321 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
WebReflection/linkedom#318 · コメント 6 件 ·
WebReflection/linkedom の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
status: waiting triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
freeCodeCamp/freeCodeCamp#70412 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug good first issue web
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100