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

Add option to show new creatable item as first or last option

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript, react
領域
frontend

調査の方向性

src/Creatable.js の 122 行目付近にあるオプション挿入箇所から始め、Creatable コンポーネントが props をどのように公開しているかを確認します。新しい creatable オプションを先頭または末尾に配置するために、要求された boolean の選択肢を追加し、それぞれの設定で期待されるオプションの順序になることを確認します。

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

説明

Hello,
I'm not sure what your general policy is for making changes to react-select-plus that are not already merged upstream into react-select but I thought I'd try anyway! 😎

Sometimes I'd like to discourage my users from creating a new option without at least looking through the list for similar options. In this case, I'd like the new "creatable" option to be last, rather than first.

I created a PR in react-select (JedWatson/react-select#1436) for this but I'm also using react-select-plus and it would be very useful for me to have it here.

The key change is adding a boolean prop to Creatable and use either unshift as it's currently doing or use push based on the prop here.

if (showNewOptionAtTop) {
  filteredOptions.unshift(this._createPlaceholderOption);
} else {
  filteredOptions.push(this._createPlaceholderOption);
}

Please let me know what you think. I'd be happy to fork and create a PR but I don't want to duplicate my changes here if you'd rather wait for them to merge it upstream.

Thanks!

主要言語
JavaScript
スター
284
フォーク
90
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

HubSpot/react-select-plus のほかの issue

HubSpot/react-select-plus の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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