Skip to content

Commit

Permalink
Improve MinimalNumericInput public API.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Aug 20, 2024
1 parent 68666f4 commit 10922be
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions dist/cjs/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cjs/main.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/esm/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/esm/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@

console.log('Default NumericInput value is ' + input.value);

input.onSelectionChange((value) => {
input.onValueChange((value) => {
console.log('The new value is ' + value);
});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main.min.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/blueprintjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2450,15 +2450,15 @@ blueprintjs.MinimalNumericInput = class extends blueprintjs.Blueprintjs {
}

/**
* Listen to the `selection-change` event.
* Listen to the `value-change` event.
*
* @param {function(number): void} callback the callback to call when the event is triggered.
* @name onSelectionChange
* @name onValueChange
* @function
* @public
*/
onSelectionChange(callback) {
this.observers_.register('selection-change', (value) => {
onValueChange(callback) {
this.observers_.register('value-change', (value) => {
// console.log('Selected value is ' + value);
if (callback) {
callback(value);
Expand All @@ -2479,7 +2479,7 @@ blueprintjs.MinimalNumericInput = class extends blueprintjs.Blueprintjs {
leftIcon: this.icon,
intent: this.intent,
onValueChange: (value) => {
this.observers_.notify('selection-change', value);
this.observers_.notify('value-change', value);
}
});
}
Expand Down

0 comments on commit 10922be

Please sign in to comment.