Skip to content

allowClear will cause selections shifted to the next line in multiple select #4470

@JLHwung

Description

@JLHwung

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate
  • The issue still exists against the latest master branch of Select2
  • This is not a usage question (Those should be directed to the community)
  • I have attempted to find the simplest possible steos to reproduce the issue
  • I have included a failing test as a pull request (Optional)

Steps to reproduce the issue

  1. Add an array of seven 3-digit choices, use allowClear option and multiple option, set the parent width to 600px;
  2. Select all the choices

Snippet (Talk is cheap)

http://codepen.io/JLHwung/pen/YWAGjG

Related issues

#3906

Expected behavior and actual behavior

When I follow those steps, the 6th choice looks really bad.

I was expecting all the choices look good.

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Not tested on other operating system but I believe it is a general CSS problem.

Libraries

  • jQuery version: 2.1.4
  • Select2 version: 4.0.3

Isolating the problem

  • This bug happens on the examples page
  • The bug happens consistently across all tested browsers
  • This bug happens when using Select2 without other pluigns
  • I can reproduce this bug in a codepen

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions