[Bug]: fluent-slider initial value is not submitted with the form
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript, web-dev
- 領域
- frontend, full-stack
調査の方向性
fluent-sliderの実装とフォーム値の設定を見つけ、issueで説明されているinitialValueChanged()とsetupDefaultValue()を特に確認してください。接続前に初期のvalue属性がどのように処理されるかを追跡し、ネイティブのrange入力の動作と比較してください。リンクされた例で再現し、スライダーを動かす前にFormDataにlevelが含まれることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Component
Slider
Package version
3.1.3
@microsoft/fast-element version
3.0.4
Environment
OS: Windows 11
Browsers: Microsoft Edge 155 (Chromium 155)
npmPackages:
@fluentui/web-components: 3.1.3
@microsoft/fast-element: 3.0.4
Current Behavior
When <fluent-slider> is rendered with a value attribute (e.g. server-rendered HTML), slider.value returns that value, but the form value is never set. The slider is missing from the submitted form data until its value is changed.
The value attribute is applied before the element is connected, so initialValueChanged only sets _value. Then setupDefaultValue() skips the value setter because _value is already set, so setFormValue() is never called:
setupDefaultValue() {
if (!this._value) {
this.value = this.initialValue ?? this.midpoint;
}
// ...
}
Expected Behavior
The initial value is submitted with the form, like <input type="range" value="7">.
Reproduction
https://oonoobmasteroo.github.io/fluent-slider-form-value/ (source: https://github.com/oONoobMasterOo/fluent-slider-form-value)
Steps to reproduce
- Open the reproduction:
<form id="form">
<fluent-slider name="level" min="0" max="10" value="7"></fluent-slider>
<input name="native" type="range" min="0" max="10" value="7">
<button type="button" id="check">Show FormData</button>
</form>
<pre id="out"></pre>
<script type="module">
import "https://cdn.jsdelivr.net/npm/@fluentui/[email protected]/dist/web-components.min.js";
document.getElementById("check").addEventListener("click", () => {
const slider = document.querySelector("fluent-slider");
const data = Object.fromEntries(new FormData(document.getElementById("form")));
document.getElementById("out").textContent = JSON.stringify({ sliderValue: slider.value, formData: data }, null, 2);
});
</script>
- Click Show FormData.
sliderValueis"7", butformDataonly containsnative:{ "native": "7" }.- Move the slider (or set
slider.valuefrom script) and click again:levelis now informData.
Are you reporting an Accessibility issue?
no
Suggested severity
Medium - Has workaround
Products/sites affected
Fluent UI Blazor (FluentSlider in statically rendered forms)
Are you willing to submit a PR to fix?
yes
Validations
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
- 主要言語
- TypeScript
- スター
- 20.3k
- フォーク
- 2.9k
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 53
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/fluentui のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Docs]: Customizing components with slots - bad url対応中かも @Avanti-27 が 3 日前に担当しました。 オープンArea: Documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
microsoft/fluentui#36903 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
@fluentui/web-components: fluent-menu-list loses its arrow keys after it is moved in the DOM (Firefox, Safari)対応中かも @asxxb が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[Feature]: export getHashCode for Avatar from avatar.ts for Fluentv8 PersonaInitialsColor / PersonaCoin support対応中かも @ValentinaKozlova が 20 日前に担当しました。 オープンComponent: Avatar Fluent UI react-components (v9) From Shield Needs: Backlog review Type: Feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/fluentui#36802 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: WeeklyDayPicker showing incorrect week number when navigating to different weeks対応中かも @Sanjays2402 が 38 日前に担当しました。 オープンComponent: CalendarDayGrid Component: WeeklyDayPicker Fluent UI react (v8) Type: Bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/fluentui#36721 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/fluentui の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
simkimsia/netlify-axi#19 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
subhranshudash13-dotcom/Contribo#74 ·
メンテナーはふだん 1 日以内に返信
-
enhancement frontend good first issue Stellar Wave trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Godgift-care/sci-healthcare-frontend#166 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue security Stellar Wave trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Godgift-care/sci-healthcare-backend#171 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信