v6: allow combobox to be built from native form elements

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
html, javascript

調査の方向性

Start by comparing the proposed native input-and-datalist markup with the existing v6 Forms combobox example linked in the issue. Determine the scope needed for JavaScript to support this simpler markup while retaining the current customizable syntax; done means the API and required accessibility behavior are agreed, since the issue does not specify implementation files or tests.

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

説明

docs feature html js needs-decision v6
Prerequisites
Proposal

Maybe this is too big a change since we're already in alpha, but I just tried the new combobox form component out today. I noticed that it's extremely verbose, but also that it's really just a well-styled version of an <input> with a <datalist>.

Since this is a JS-powered component, there's no need for the base markup to be so verbose. IMO having markup something like the following would be preferable to the example given in the docs.

<div class="form-field">
    <label for="country">Combobox</label>
    <input name="country" id="country" class="combobox-input" list="countryList" placeholder="Select a country…"/>
    <datalist id="countryList">
        <option value="au">Australia</option>
        <option value="ca">Canada</option>
        <option value="uk">United Kingdom</option>
    </datalist>
</div>

Given that HTML, the JavaScript can hook onto the .combobox-input class to build the menu structure, trigger button/caret SVG, and (optional) search input, instead of requiring authors to include it all. Authors would remain free to use the current syntax to manually build out their comboboxes if they require more customization.

Motivation and context
  • Fallback: these are native HTML elements so will work even without JS
  • Guaranteed accessibility: the JS can ensure proper roles and ARIA attributes are added to menus and trigger buttons
  • Intuitive markup: these are native HTML elements so the input name, option values, etc. are immediately clear to authors
主要言語
JavaScript
スター
175k
フォーク
78.9k
平均マージ
4日 2時間
マージ済み PR(30日)
89

環境構築

はじめの一歩

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

twbs/bootstrap のほかの issue

twbs/bootstrap の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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