Skip to content

Commit

Permalink
Remove check in validateChanges and add additional check for cell val…
Browse files Browse the repository at this point in the history
…idator to finishEditing in baseEditor #5893
  • Loading branch information
pnowak committed Jun 6, 2019
1 parent bae2e15 commit f4abba4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/core.js
Expand Up @@ -927,8 +927,7 @@ export default function Core(rootElement, userSettings, rootInstanceSymbol = fal
if (isFunction(beforeChangeResult)) {
warn('Your beforeChange callback returns a function. It\'s not supported since Handsontable 0.12.1 (and the returned function will not be executed).');

} else if (beforeChangeResult === false || Array.isArray(beforeChangeResult) &&
(!beforeChangeResult.length || (beforeChangeResult.length === 1 && beforeChangeResult[0] === null))) {
} else if (beforeChangeResult === false) {
const activeEditor = instance.getActiveEditor();

if (activeEditor) {
Expand Down
2 changes: 1 addition & 1 deletion src/editors/_baseEditor.js
Expand Up @@ -289,7 +289,7 @@ class BaseEditor {
this.state = EditorState.WAITING;
this.saveValue(val, ctrlDown);

if (this.hot.getCellValidator(this.cellProperties)) {
if (this.hot.getCellValidator(this.cellProperties) && !this.hot.getSettings().beforeChange) {
this.hot.addHookOnce('postAfterValidate', (result) => {
this.state = EditorState.FINISHED;
this.discardEditor(result);
Expand Down

0 comments on commit f4abba4

Please sign in to comment.