Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nutrition input numeric #2605

Closed
MauroMombelli opened this issue May 5, 2019 · 19 comments · Fixed by #3126
Closed

Make nutrition input numeric #2605

MauroMombelli opened this issue May 5, 2019 · 19 comments · Fixed by #3126
Labels
editing Issues relating to allowing the user to edit products feature mockup-available P1 product addition

Comments

@MauroMombelli
Copy link

Summary:

Make the input box for nutritional fact numeric

Steps to reproduce:

if you try to add the nutritional fact, the full keyboard appears instead of the numeric

@huzaifaiftikhar
Copy link
Member

We can't have a numeric input type for nutritional fact because we need to type the following characters as well "<", ">"and "~". It is not possible to type these on a numeric input type.

@MauroMombelli
Copy link
Author

Sorry for the late answer.
While i agree those information may be important to collect, I also know those symbols are little and well known.
IMHO a better approach would be to keep the field numeric and instead add those symbols to the drop box (or add another drop box) as this would make the parsing of the field much easier (also in a database query, looking for specific values would be much better.)

@huzaifaiftikhar
Copy link
Member

@MauroMombelli Your suggestion looks good to me! I am reopening this issue.

@vanshikaarora
Copy link
Contributor

@MauroMombelli @huzaifaiftikhar Can I please take this Issue if you are not working on it?

@huzaifaiftikhar
Copy link
Member

@vanshikaarora go ahead :)

@vanshikaarora
Copy link
Contributor

Thanks @huzaifaiftikhar for assigning the work to me:)

Well before working upon I would mention all the changes that I'll be making. As I see in nutrition fact only Serving size has a numeric keyboard while all other fields have full keyboard. So I need to change input type for all of them as numeric. Well, if there anything else you would like to add then please inform here:)

@vanshikaarora
Copy link
Contributor

Hey @huzaifaiftikhar I have raised a PR here #2650 Can you please review :)

@huzaifaiftikhar
Copy link
Member

@vanshikaarora I have gone through the PR, I guess you didn't get the issue exactly. Anyway, I'll try to explain to my best.
Currently, we have a full keyboard for all the nutrition facts fields (except serving size) because we need to type these characters as well "<", ">" and "~". By simply changing the input type to numeric won't fix the issue as the user won't be able to input the above characters then. To fix this I would suggest you add a spinner before the input field (similar to the one already present for units) which would contain these characters as suggested by @MauroMombelli.

@vanshikaarora
Copy link
Contributor

@huzaifaiftikhar I am sorry for not understanding the exact issue before. And thanks for explaining it as well:) .

To fix this I would suggest you add a spinner before the input field (similar to the one already present for units) which would contain these characters as suggested by @MauroMombelli.

While fixing this, I felt that this is disturbing the UI and adding two spinners for each field makes it a big congested. So, how about adding a single spinner just next to the radio boxes. Whenever the user taps on edit text numeric keyboard pops up and the spinner,next to radio boxes for these characters becomes visible?

@huzaifaiftikhar
Copy link
Member

huzaifaiftikhar commented May 24, 2019

@vanshikaarora I guess the spinner beside the radio boxes won't be visible when we are inputting the last nutrient for a long list of nutrients. Can you post screenshots for both the approaches?

@vanshikaarora
Copy link
Contributor

Hey @huzaifaiftikhar here are the screenshots for both the states

Screenshot_20190524_133536
The position of the spinner in this could be either right or left

Screenshot_20190524_134227
The position and appearence of this single spinner can even be modified further

@huzaifaiftikhar
Copy link
Member

@teolemon @deniger @brandenfung @Karljoones Can you take a look at this? Which UI seems appropriate?

@MauroMombelli
Copy link
Author

MauroMombelli commented May 24, 2019 via email

@vanshikaarora
Copy link
Contributor

@huzaifaiftikhar Are the symbols very frequently used while filling these fields? If not, then I think that just one spinner for all could a better option(position of this can be decided according to convenience).

Rest I leave it upon the opinion of other community members, to decide. And I'll modify accordingly:)

@huzaifaiftikhar
Copy link
Member

I'm pretty sure that these symbols are not used often. Keeping a single spinner can work provided that it doesn't create any confusion for the user.
I'm waiting for others to take a look at this.

@vanshikaarora
Copy link
Contributor

I'm pretty sure that these symbols are not used often. Keeping a single spinner can work provided that it doesn't create any confusion for the user.

@teolemon @deniger @brandenfung @Karljoones Can you please pitch in your suggestions too? I'll add single spinner at the appropriate position, if you agree with it.

@deniger
Copy link
Contributor

deniger commented May 27, 2019

IMHO, i'll try to do something like that but I will let @teolemon gives his feedback :)
image

  • a spinner for each line as this info can change

If it's the chosen solution, the code should be organized to avoid duplicated block ....

@tur-ium
Copy link

tur-ium commented Nov 16, 2019

Any updates with regard to this issue? It would significantly speed up data entry to have a numeric input. I created a fork to change the input type before finding this thread. I'd personally go for a gross between @deniger and @vanshikaarora 's solutions. Have a light grey dropdown (as @vanshikaarora) and add symbols (as @deniger).

@teolemon
Copy link
Member

@deniger your solution seems reasonable. This bug passed under my radar.

@VaiTon VaiTon added editing Issues relating to allowing the user to edit products feature labels Nov 16, 2019
@VaiTon VaiTon changed the title [feature request] make nutrition input numeric Make nutrition input numeric Nov 16, 2019
@teolemon teolemon added the P1 label May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editing Issues relating to allowing the user to edit products feature mockup-available P1 product addition
Projects
None yet
7 participants