Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

fix: #2692 Tabbing / clicking / returning out of a number field round your input#3427

Merged
cwhitten merged 11 commits intomicrosoft:masterfrom
LouisEugeneMSFT:leugene/issue2692
Jun 24, 2020
Merged

fix: #2692 Tabbing / clicking / returning out of a number field round your input#3427
cwhitten merged 11 commits intomicrosoft:masterfrom
LouisEugeneMSFT:leugene/issue2692

Conversation

@LouisEugeneMSFT
Copy link
Contributor

@LouisEugeneMSFT LouisEugeneMSFT commented Jun 18, 2020

Description

The field (Composer/packages/extensions/adaptive-form/src/components/fields/NumberField.tsx) was always rounding numbers to be integers since onValidate calls updateValue(0).
In the case of floats, updateValue(0) would call getFloat(value, 0), which would call .toFixed(0).

This is because the step variable was used in different places for different purposes. In the case of getFloat it was used both for incrementing and rounding, which is incorrect.

The PR therefore makes the rounding "amount" a separate variable (floatNumberOfDecimals).

Task Item

fixes #2692

Screenshots

image

@LouisEugeneMSFT LouisEugeneMSFT changed the title [Bug fix - #2692] Tabbing / clicking / returning out of a number field round your input fix: #2692 Tabbing / clicking / returning out of a number field round your input Jun 18, 2020
Copy link
Contributor

@a-b-r-o-w-n a-b-r-o-w-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, try to add a test case for this. Fabric does not make testing the SpinButton very easy, so just do what you can.

@coveralls
Copy link

coveralls commented Jun 22, 2020

Coverage Status

Coverage increased (+0.004%) to 47.818% when pulling 4e99a49 on LouisEugeneMSFT:leugene/issue2692 into 803e639 on microsoft:master.

@cwhitten
Copy link
Member

@vishwacsena @tomlm can you comment to the introduction of multipleOf to specify precision on a number type? See "Validations" on https://cswr.github.io/JsonSchema/spec/basic_types/

@luhan2017
Copy link
Contributor

@cwhitten , It seems I have some misunderstanding here, I was trying to say that
For the NumberInput, we can use the outputFormat(=formatNumber(this.value, 2)) property to define the precision of the number type.
Here is an example:
image
image

This means user can set precision of the output by formatNumber expression in LG.
This seems not relate to what you want.
I don't quite understand what is the multipleOf used for. Do you mean to define the precision of a number variable in the component schema?

@cwhitten
Copy link
Member

@luhan2017 @LouisEugeneMSFT let's take this and continue discussion to determine if we want to allow the the number type to include a precision option, so that you don't need to format using lg.

@cwhitten cwhitten requested a review from a-b-r-o-w-n June 24, 2020 18:11
@cwhitten cwhitten merged commit 059fcb4 into microsoft:master Jun 24, 2020
beyackle added a commit that referenced this pull request Jun 29, 2020
* link the application keys with bot service in provision script (#3425)

* fix: #3309 Allow configuring app settings without opening a bot project (#3454)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: 'Ctrl + Click', 'Shift + Click' behaviors in Flow Editor (#3448)

* ctrl + click behavior

* enhance the focus behavior

* range selection e2e

* calculate accurate range selection

* MacOS Meta + Click support

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: fix relative path of runtime folder in eject customized (#3434)

* fix runtime relative path in eject

* fix process pid not exist when runtime folder not exist

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: typo (#3474)

* Fix a typo

Message recieved -> Message received

* Improve language

A basic brush of the Home page.

* fix: fix get history before file persistence (#3440)

* fix get history before file persistence

* flush in action not in component

* fix bug

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: #2692 Tabbing / clicking / returning out of a number field round your input (#3427)

* bug fix

* pr comment

* lint

* double export

* updated test

Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: revert plugins out of workspace (#3479)

* revert commit about add plugins into workspace

* revert other relative path change

* update the lock file

* remove yarn.lock in azure plugins to make sure bot-deploy updated

Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: Hide ignored folders in vscode, update prettier config (#3493)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

* fix: #3485

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: show 'AutoEndDialog' from Adaptive Dialog Property Editor (#3498)

* refactor: add rule and remove dangling underscores (#3496)

* add rule and remove dangling underscores

* update elliptic and test

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: added config to debug Electron main process. (#3501)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* Merge pull request #3502 from hatpick/master

fix: #3486 Debug/Fix HMR support

* fix: add logo-clicking to tests (#3500)

* add logo-clicking to tests

* bump elliptic version

* Update yarn.lock

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* feat: support validate lg custom functions (#3273)

* fix: support validate lg custom functions and separate the dialog validation from parser

* use file name as namespace

* add unit test

* fix lint

* fix: inline editing LU mess up whole file (#3478)

* upgrade lu packages

* update package

* clean

* update

* clean up

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* refactor: change term primary key to authoring key (#3516)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

Co-authored-by: Qi Kang <kangqidev@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: zeye <2295905420@qq.com>
Co-authored-by: VanyLaw <wenyluo@microsoft.com>
Co-authored-by: Yan Liu <32497439+zxyanliu@users.noreply.github.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: LouisEugeneMSFT <66701106+LouisEugeneMSFT@users.noreply.github.com>
Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: TJ Durnford <tjdford@gmail.com>
Co-authored-by: Tony Anziano <toanzian@microsoft.com>
Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com>
Co-authored-by: liweitian <liweitian93@outlook.com>
@cwhitten cwhitten mentioned this pull request Jul 8, 2020
benbrown pushed a commit to benbrown/BotFramework-Composer that referenced this pull request May 24, 2021
* link the application keys with bot service in provision script (microsoft#3425)

* fix: microsoft#3309 Allow configuring app settings without opening a bot project (microsoft#3454)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: 'Ctrl + Click', 'Shift + Click' behaviors in Flow Editor (microsoft#3448)

* ctrl + click behavior

* enhance the focus behavior

* range selection e2e

* calculate accurate range selection

* MacOS Meta + Click support

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: fix relative path of runtime folder in eject customized (microsoft#3434)

* fix runtime relative path in eject

* fix process pid not exist when runtime folder not exist

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: typo (microsoft#3474)

* Fix a typo

Message recieved -> Message received

* Improve language

A basic brush of the Home page.

* fix: fix get history before file persistence (microsoft#3440)

* fix get history before file persistence

* flush in action not in component

* fix bug

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: microsoft#2692 Tabbing / clicking / returning out of a number field round your input (microsoft#3427)

* bug fix

* pr comment

* lint

* double export

* updated test

Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: revert plugins out of workspace (microsoft#3479)

* revert commit about add plugins into workspace

* revert other relative path change

* update the lock file

* remove yarn.lock in azure plugins to make sure bot-deploy updated

Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: Hide ignored folders in vscode, update prettier config (microsoft#3493)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

* fix: microsoft#3485

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: show 'AutoEndDialog' from Adaptive Dialog Property Editor (microsoft#3498)

* refactor: add rule and remove dangling underscores (microsoft#3496)

* add rule and remove dangling underscores

* update elliptic and test

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: added config to debug Electron main process. (microsoft#3501)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* Merge pull request microsoft#3502 from hatpick/master

fix: microsoft#3486 Debug/Fix HMR support

* fix: add logo-clicking to tests (microsoft#3500)

* add logo-clicking to tests

* bump elliptic version

* Update yarn.lock

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* feat: support validate lg custom functions (microsoft#3273)

* fix: support validate lg custom functions and separate the dialog validation from parser

* use file name as namespace

* add unit test

* fix lint

* fix: inline editing LU mess up whole file (microsoft#3478)

* upgrade lu packages

* update package

* clean

* update

* clean up

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* refactor: change term primary key to authoring key (microsoft#3516)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

Co-authored-by: Qi Kang <kangqidev@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: zeye <2295905420@qq.com>
Co-authored-by: VanyLaw <wenyluo@microsoft.com>
Co-authored-by: Yan Liu <32497439+zxyanliu@users.noreply.github.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: LouisEugeneMSFT <66701106+LouisEugeneMSFT@users.noreply.github.com>
Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: TJ Durnford <tjdford@gmail.com>
Co-authored-by: Tony Anziano <toanzian@microsoft.com>
Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com>
Co-authored-by: liweitian <liweitian93@outlook.com>
benbrown pushed a commit that referenced this pull request Jun 11, 2021
* link the application keys with bot service in provision script (#3425)

* fix: #3309 Allow configuring app settings without opening a bot project (#3454)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: 'Ctrl + Click', 'Shift + Click' behaviors in Flow Editor (#3448)

* ctrl + click behavior

* enhance the focus behavior

* range selection e2e

* calculate accurate range selection

* MacOS Meta + Click support

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: fix relative path of runtime folder in eject customized (#3434)

* fix runtime relative path in eject

* fix process pid not exist when runtime folder not exist

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: typo (#3474)

* Fix a typo

Message recieved -> Message received

* Improve language

A basic brush of the Home page.

* fix: fix get history before file persistence (#3440)

* fix get history before file persistence

* flush in action not in component

* fix bug

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>

* fix: #2692 Tabbing / clicking / returning out of a number field round your input (#3427)

* bug fix

* pr comment

* lint

* double export

* updated test

Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* fix: revert plugins out of workspace (#3479)

* revert commit about add plugins into workspace

* revert other relative path change

* update the lock file

* remove yarn.lock in azure plugins to make sure bot-deploy updated

Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: Hide ignored folders in vscode, update prettier config (#3493)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

* fix: #3485

Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>

* feat: show 'AutoEndDialog' from Adaptive Dialog Property Editor (#3498)

* refactor: add rule and remove dangling underscores (#3496)

* add rule and remove dangling underscores

* update elliptic and test

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* chore: added config to debug Electron main process. (#3501)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* Merge pull request #3502 from hatpick/master

fix: #3486 Debug/Fix HMR support

* fix: add logo-clicking to tests (#3500)

* add logo-clicking to tests

* bump elliptic version

* Update yarn.lock

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* feat: support validate lg custom functions (#3273)

* fix: support validate lg custom functions and separate the dialog validation from parser

* use file name as namespace

* add unit test

* fix lint

* fix: inline editing LU mess up whole file (#3478)

* upgrade lu packages

* update package

* clean

* update

* clean up

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* refactor: change term primary key to authoring key (#3516)

Co-authored-by: Andy Brown <asbrown002@gmail.com>

Co-authored-by: Qi Kang <kangqidev@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: zeye <2295905420@qq.com>
Co-authored-by: VanyLaw <wenyluo@microsoft.com>
Co-authored-by: Yan Liu <32497439+zxyanliu@users.noreply.github.com>
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: LouisEugeneMSFT <66701106+LouisEugeneMSFT@users.noreply.github.com>
Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: leilzh <leilzh@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: TJ Durnford <tjdford@gmail.com>
Co-authored-by: Tony Anziano <toanzian@microsoft.com>
Co-authored-by: Zhixiang Zhan <zhixzhan@microsoft.com>
Co-authored-by: liweitian <liweitian93@outlook.com>
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…eld round your input (microsoft#3427)

* bug fix

* pr comment

* lint

* double export

* updated test

Co-authored-by: Louis Eugene <leugene@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabbing / clicking / returning out of a number field round your input

7 participants