Skip to content

Commit d93fd5f

Browse files
authored
fix(editor): comparing select editor value against [''] isn't valid (#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] ```
1 parent 52b29dc commit d93fd5f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/common/src/editors/selectEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ export class SelectEditor implements Editor {
496496

497497
// clear select when it's newly disabled and not yet empty
498498
const currentValues: string | number | Array<string | number> = this.getValue();
499-
const isValueBlank = this.isMultipleSelect ? currentValues === [''] as Array<string | number> : currentValues === '';
499+
const isValueBlank = Array.isArray(currentValues) && this.isMultipleSelect ? currentValues?.[0] === '' : currentValues === '';
500500
if (prevIsDisabled !== isDisabled && this.isCompositeEditor && !isValueBlank) {
501501
this.reset('', true, true);
502502
}

packages/vanilla-force-bundle/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"bundle": "npm-run-all bundle:commonjs bundle:esm webpack:prod",
3838
"bundle:commonjs": "tsc --project tsconfig.bundle.json --outDir dist/commonjs --module commonjs",
3939
"bundle:esm": "tsc --project tsconfig.bundle.json --outDir dist/esm --module esnext --target es2018",
40+
"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",
4041
"prebundle:zip": "pnpm run delete:zip",
4142
"bundle:zip": "pnpm run zip:dist",
4243
"delete:zip": "cross-env rimraf --maxBusyTries=10 dist-bundle-zip",

0 commit comments

Comments
 (0)