select2 / select2/select2

Feature request - copy data-attr's and/or classes from original select

Open
#6,254 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
25.9k
Forks
6.1k
Avg merge
8d 53m
Merged PRs (30d)
4

Description

Context

You can hide options via CSS, display: none.
But when using select2 it has no effect.
My request is to add the data-attr's so

Preview

image
image

Codebin

https://jsbin.com/sicexew/edit?html,css,js,output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in the linked JSBin and inspect how Select2 represents the original select element and its options. Define the required data attributes and class copying behavior, then verify that CSS-hidden options behave as requested without changing unrelated select rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.