Skip to content

Commit

Permalink
chore(select): remove deprecated option includeBlank on selects
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove deprecated option `includeBlank` on select
inputs.
  • Loading branch information
anehx committed Sep 8, 2022
1 parent b0b0bde commit 3ef60b2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 24 deletions.
1 change: 0 additions & 1 deletion addon/components/validated-input.hbs
Expand Up @@ -50,7 +50,6 @@
@optionLabelPath={{@optionLabelPath}}
@optionValuePath={{@optionValuePath}}
@optionTargetPath={{@optionTargetPath}}
@includeBlank={{@includeBlank}}
@multiple={{@multiple}}
@update={{this.update}}
@setDirty={{this.setDirty}}
Expand Down
1 change: 0 additions & 1 deletion addon/components/validated-input/render.hbs
Expand Up @@ -13,7 +13,6 @@
{{#if (eq @type "select")}}
<this.selectComponent
@disabled={{@disabled}}
@includeBlank={{@includeBlank}}
@inputId={{@inputId}}
@isInvalid={{@isInvalid}}
@isValid={{@isValid}}
Expand Down
4 changes: 2 additions & 2 deletions addon/components/validated-input/types/select.hbs
Expand Up @@ -23,12 +23,12 @@
{{on "blur" this.onBlur}}
...attributes
>
{{#if (or @prompt @includeBlank)}}
{{#if @prompt}}
<option
value=""
disabled={{not @promptIsSelectable}}
selected={{not @value}}
>{{or @prompt @includeBlank}}</option>
>{{@prompt}}</option>
{{/if}}

{{#if this.hasGrouping}}
Expand Down
19 changes: 0 additions & 19 deletions addon/components/validated-input/types/select.js
@@ -1,4 +1,3 @@
import { deprecate } from "@ember/debug";
import EmberObject, { action, get } from "@ember/object";
import Component from "@glimmer/component";

Expand All @@ -9,24 +8,6 @@ import Component from "@glimmer/component";
* the block syntax for options.
*/
export default class SelectComponent extends Component {
constructor(...args) {
super(...args);

if (this.args.includeBlank) {
deprecate(
"The `includeBlank` property is deprecated. Please use `prompt` instead.",
false,
{
id: "ember-validated-form:NoMoreincludeBlank",
until: "6.0.0",
since: "5.1.0",
url: "https://github.com/adfinis/ember-validated-form/releases/tag/v5.1.0",
for: "ember-validated-form",
}
);
}
}

get hasPreGroupedOptions() {
return (
this.args.options[0]?.groupName &&
Expand Down
Expand Up @@ -102,7 +102,6 @@ The select element also supports the following options:
- `optionLabelPath`
- `optionValuePath`
- `optionTargetPath`
- `includeBlank` (deprecated in favor of `prompt`)
- `prompt`
- `promptIsSelectable`
- `groupLabelPath`
Expand Down
7 changes: 7 additions & 0 deletions tests/dummy/app/templates/docs/migration-v6.md
@@ -1,5 +1,7 @@
# Migration to v6

## Config

`ember-validated-form` is heavily based on dynamic component invokation which
needed alot of changes in order to make it work with embroider. For the
consumers of the addon, the only thing that changes is the static configuration.
Expand Down Expand Up @@ -51,3 +53,8 @@ const app = new EmberAddon(defaults, {
As you can see above, the values in the section `defaults` changed as well.
Previously the value was just the name of the component used as default, since
v6 this needs to be an importable path (which allows static analysis).

## Removed deprecations

The `includeBlank` argument for validated inputs has been removed in favor of
`prompt`.

0 comments on commit 3ef60b2

Please sign in to comment.