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

[UX][DX] Change the weight field in the taxonomy term form to a number field #3592

Closed
klonos opened this issue Mar 17, 2019 · 6 comments
Closed

Comments

@klonos
Copy link
Member

klonos commented Mar 17, 2019

This is currently a text field, so we also need a is_numeric() check in taxonomy_form_term_validate() to make sure there is no wrong input.

If this was a proper number field, then the user could use their keyboard up/down key to change, and there would also be no need for the check in the form validation function. Less code/complexity++ 😄


PR by @klonos: backdrop/backdrop#2535

@klonos
Copy link
Member Author

klonos commented Mar 17, 2019

...we also have a '#type' => 'weight' field, but that field is by default limited to values ranging from -10 to 10 unless you specify a higher #delta. The #delta in the taxonomy listing pages, such as in /admin/structure/taxonomy/tags seems to be currently set to 30.

So question is do we want this field to be limited to a specific set of weights, or leave it as '#type' => 'number', which gives users more freedom?

@klonos klonos changed the title Change the weight field in the taxonomy term form to a number field [UX][DX] Change the weight field in the taxonomy term form to a number field Mar 17, 2019
@herbdool
Copy link

This looks okay to me. It seems to limit it to the number of terms. So with 4 terms it goes from minus to plus four.

@klonos
Copy link
Member Author

klonos commented Mar 26, 2019

It seems to limit it to the number of terms. So with 4 terms it goes from minus to plus four.

Sorry, what? I don't understand this, but it sounds like something that we should fix.

@jenlampton is of the opinion that we should change this to '#type' => 'weight', but as I said in #3593:

Sure. The only reason I may sound skeptical about using fields of type #weight is because they are limiting to a specific min/max value. Number fields are easy to use with the mouse scroll when focused (no additional clicks).

Having said that, I'm glad to switch the PR to #weight, but I need to know what to use for the #delta value for it?

What do you think @herbdool? ...others?

@herbdool
Copy link

@klonos seems like by design to me. It also works that way without this PR.

I don't know if I even tested this in the right place. It's not clear from the description.

@klonos
Copy link
Member Author

klonos commented Mar 28, 2019

OK, so changing weight fields to number fields, with min/max values instead of #delta (if that's required) seems like something we'll attempt in #3626.

Adding milestone tag for 1.12.6

@quicksketch
Copy link
Member

The scope of backdrop/backdrop#2535 is limited and does exactly one thing (changing textfield to number) and doesn't get into the general weight field problems of #3626. I've merged the PR into 1.x and 1.12.x. Thanks @klonos and @herbdool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants