Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove modules deprecated in 4.0.0 #5815

Merged
merged 16 commits into from Apr 19, 2020
Merged

Remove modules deprecated in 4.0.0 #5815

merged 16 commits into from Apr 19, 2020

Conversation

kevin-brown
Copy link
Member

This pull request includes a

  • Bug fix
  • New feature
  • Translation
  • Miscellaneous

The following changes were made

  • Remove <input /> support
  • Remove initSelection
  • Remove query
  • Promote dropdownCss to a core module
  • Promote containerCss to a core module and rename to selectionCss

Fixes #3294

This never actually really worked, and since we thought this commit
was coming sooner, we never actually fixed it. Now we can just
remove it and accept the fact that Select2 currently only works
for `<select>` boxes, the things it advertises itself as being a
replacement for.

Closes #3294.
These features will be removed in upcoming commits.
These were originally slate to be deprecated and removed during the
4.1.0 release, but it has been determined that they should still
remain in the core. These will be stripped down to only the essentials
before the 4.1.0 release, sincce we don't want to have to continue
supporting another 6 options on top of the ones we already have.
This removes the two options that were specific to the CSS for a
dropdown. These two options were not well documented and as a result
are not widely used.

* dropdownCss - Allowed for custom CSS styles to be injected on the
  dropdown container. Had an undocumented feature where the CSS
  could be customized per element by passing in a function as the
  option.

  There is no immediate replacement for this option since Select2
  will only allow custom CSS classes going forward. The best option
  is to create a new CSS class which covers the properties that
  were previously being injected.

* adaptDropdownCssClass - Allowed for the CSS classes which were
  present on the original element to be cloned into the set of
  CSS classes which were on the dropdown container.  This was only
  documented as a possible option but the rest of the documentation
  was left blank, probably because nobody knew what this did.
  Internally this was used to make the `:all:` helper function within
  the `dropdownCssClass` option.

  The suggested replacement for this is to change the CSS classes
  on the original element prior to initializing Select2, and to use
  the `:all:` helper to copy those classes over. The `:all:` helper
  will remain as a supported option going forward.
This removes the two options that were specific to the CSS for a
selection container. These two options were not well documented and
as a result are not widely used.

* containerCss - Allowed for custom CSS styles to be injected on the
  selection container. Had an undocumented feature where the CSS
  could be customized per element by passing in a function as the
  option.

  There is no immediate replacement for this option since Select2
  will only allow custom CSS classes going forward. The best option
  is to create a new CSS class which covers the properties that
  were previously being injected.

* adaptContainerCssClass - Allowed for the CSS classes which were
  present on the original element to be cloned into the set of
  CSS classes which were on the selection container.  This was only
  documented as a possible option but the rest of the documentation
  was left blank, probably because nobody knew what this did.
  Internally this was used to make the `:all:` helper function within
  the `containerCssClass` option.

  The suggested replacement for this is to change the CSS classes
  on the original element prior to initializing Select2, and to use
  the `:all:` helper to copy those classes over. The `:all:` helper
  will remain as a supported option going forward.
Removed `adaptContainerCssClass`, `adaptDropdownCssClass`,
`containerCss`, and `dropdownCss` which are now no longer supported
with the promotion of `dropdownCssClass` and `selectionCssClass` to
the core builds.

Renamed `containerCssClass` to `selectionCssClass` to reflect the
new name.

Documented the `dir` option and pointed to the MDN documentation on
the `dir` attribute.

Removed `initSelection` and `query` which were used with the
now-removed support of `<input />` tags.
Now that we are not dynamically loading in any modules for the full
builds, we do not need the ability to override the AMD base path to
search for these additional modules at. The `amdLanguageBase` option
is still needed to handle dynamically loading in the additional
lanugage files, though we acknowledge that nobody appears to be
using this option.
This was an undocumented feature that we are dropping to ease the
the maintenance burden now that the `dropdownCssClass` and
`selectionCssClass` options are being included in all builds.
This should help alleviate much of the confusion that comes from
people who used Select2 3.x and were used to these classes being
injected at the container which wrapped the selection container
instead of on the selection container itself. Now this makes it more
clear what container these classes are being applied to.
We were lacking a test that verified that original classes were not
copied unless `:all:` was actually specified.
@kevin-brown kevin-brown marked this pull request as ready for review April 19, 2020 16:24
@kevin-brown kevin-brown merged commit f999ed8 into develop Apr 19, 2020
@kevin-brown kevin-brown deleted the GH-3294 branch April 19, 2020 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop legacy support for <input /> tag
1 participant