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

[Bug]: fluent-slider initial value is not submitted with the form

オープン 初心者向け
#36,927 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript, web-dev

調査の方向性

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
  1. 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>
  1. Click Show FormData.
  2. sliderValue is "7", but formData only contains native: { "native": "7" }.
  3. Move the slider (or set slider.value from script) and click again: level is now in formData.
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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

microsoft/fluentui のほかの issue

microsoft/fluentui の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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