Skip to content

Commit

Permalink
fix(editor): comparing select editor value against [''] isn't valid (
Browse files Browse the repository at this point in the history
…#909)

- the error came from ESbuild when trying to bundle the lib, the warning is the following
```sh
 [WARNING] Comparison using the "===" operator here is always false [equals-new-object]
 ```
  • Loading branch information
ghiscoding committed Feb 17, 2023
1 parent 52b29dc commit d93fd5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/src/editors/selectEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ export class SelectEditor implements Editor {

// clear select when it's newly disabled and not yet empty
const currentValues: string | number | Array<string | number> = this.getValue();
const isValueBlank = this.isMultipleSelect ? currentValues === [''] as Array<string | number> : currentValues === '';
const isValueBlank = Array.isArray(currentValues) && this.isMultipleSelect ? currentValues?.[0] === '' : currentValues === '';
if (prevIsDisabled !== isDisabled && this.isCompositeEditor && !isValueBlank) {
this.reset('', true, true);
}
Expand Down
1 change: 1 addition & 0 deletions packages/vanilla-force-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"bundle": "npm-run-all bundle:commonjs bundle:esm webpack:prod",
"bundle:commonjs": "tsc --project tsconfig.bundle.json --outDir dist/commonjs --module commonjs",
"bundle:esm": "tsc --project tsconfig.bundle.json --outDir dist/esm --module esnext --target es2018",
"bundle:web": "esbuild src/index.ts --bundle --minify --format=iife --sourcemap --target=es2018 --main-fields=module,main --external:jquery --global-name=Slicker --outfile=dist/bundle/slickgrid-vanilla-bundle.js",
"prebundle:zip": "pnpm run delete:zip",
"bundle:zip": "pnpm run zip:dist",
"delete:zip": "cross-env rimraf --maxBusyTries=10 dist-bundle-zip",
Expand Down

0 comments on commit d93fd5f

Please sign in to comment.