bug: setting an ion-label's textContent early results in double labels

オープン
#30,749 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
frontend

調査の方向性

CodePen の再現から始め、ion-label の実装と textContent の処理を調べてから、関係する StencilJS のパッチ処理を追跡します。完了条件は、アタッチ前に textContent を設定し、その後に再設定すると新しい方のラベルテキストだけが残ることと、両方の設定をカバーする回帰テストがあることです。

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

説明

stencil type: bug
Prerequisites
Ionic Framework Version

v8.x

Current Behavior

When setting a new <ion-label> instance's textContent before it is attached to the document and then after attaching it re-assigning a new textContent value will leave both visible.

See: https://codepen.io/ErikOnBike/pen/XJXqZxR

Expected Behavior

The second assignment to the textContent property should remove the existing textContent value.

Steps to Reproduce

See: https://codepen.io/ErikOnBike/pen/XJXqZxR

Code Reproduction URL

https://codepen.io/ErikOnBike/pen/XJXqZxR

Ionic Info

n/a

Additional Information

This might be the effect of StencilJS' textContent patching. I'm not sure if I fully understand why StencilJS does all kinds of patching for WebComponents. It overrides things like children, childNodes and textContent which results in awkward behaviour if you're not following the standard Angular/Vite approach of dealing with DOM manipulation. I bumped into this a number of times now (I'm not using the mentioned frameworks).

主要言語
TypeScript
スター
52.8k
フォーク
13.3k
平均マージ
3日 1時間
マージ済み PR(30日)
86

環境構築

はじめの一歩

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

ionic-team/ionic-framework のほかの issue

ionic-team/ionic-framework の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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