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

Fix inconsistencies in "HTML attribute: step" doc #31872

Merged
merged 6 commits into from
Jan 27, 2024

Conversation

nwhittaker
Copy link
Contributor

Description

Fixes a typo in the min impact on step section where the default step value is said to be 0 instead of 1.

Motivation

Otherwise the doc is inconsistent with what it claims the default step value to be.

Additional details

Related issues and pull requests

Fix a typo in the **min impact on step** section where the default `step` value is said to be `0` instead of `1`.
@nwhittaker nwhittaker requested a review from a team as a code owner January 23, 2024 22:27
@nwhittaker nwhittaker requested review from chrisdavidmills and removed request for a team January 23, 2024 22:27
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed labels Jan 23, 2024
Copy link
Contributor

github-actions bot commented Jan 23, 2024

Preview URLs

(comment last updated: 2024-01-26 13:28:49)

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Hi @nwhittaker, and thanks for your contribution to MDN!

Your change is correct, but I also wondered if you fancied correcting the example description, starting with the following line:

Then define an input with a minimum value of 7.2, omitting the step attribute, wherein it defaults to 1.

This is an incorrect description of the code below, as step is not omitted; it is set to 2. And the min value set is 1.2, not 7.2.

Also, the text starting Valid values include... is not accurate — it says number values with decimals are invalid, which is nonsense. If you try the live example, 1.2, etc. do not show as invalid. If you try a value like a, the red border is immediately shown.

Let me know what you think.

@nwhittaker
Copy link
Contributor Author

@chrisdavidmills, happy to roll in other changes.


Then define an input with a minimum value of 7.2, omitting the step attribute, wherein it defaults to 1.

This is an incorrect description of the code below, as step is not omitted; it is set to 2. And the min value set is 1.2, not 7.2.

I think this is a straightforward enough change.


Also, the text starting Valid values include... is not accurate — it says number values with decimals are invalid, which is nonsense. If you try the live example, 1.2, etc. do not show as invalid. If you try a value like a, the red border is immediately shown.

The author does say even numbers with a .2 decimal are invalid which is accurate given the constraints: Integers and even numbers followed by .2 are not valid. However, I'd agree it's still confusing since those aren't the only decimal numbers that are invalid (e.g. 1.3, 2.1, etc…). May be easier to describe the values that are valid instead of the ones that are invalid?

I also don't get what is meant by, As we included an invalid value, supporting browsers will show the value as invalid. I'm guessing the input's value was initially set with an invalid number at one point? Any reason to keep this sentence?

I'll take a stab at rewording some of this, but interested in any feedback you may have regarding specific wording you'd like to see.

@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Jan 26, 2024
@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Jan 26, 2024
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

@nwhittaker your changes look great, thanks!

I've also made a commit to the branch to do a bit of text cleaning and restructuring in other places; after reviewing your changes I kept noticing other things, and couldn't leave it alone ;-)

I'll leave it like this for now, so that you can chime in if there is anything else you'd like to update, and the system can regenerate the preview link so I can test it and make sure my changes work.

chrisdavidmills and others added 2 commits January 26, 2024 13:23
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@nwhittaker nwhittaker changed the title Fix incorrect default value in "HTML attribute: step" doc Fix inconsistencies in "HTML attribute: step" doc Jan 26, 2024
Copy link
Contributor Author

@nwhittaker nwhittaker left a comment

Choose a reason for hiding this comment

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

I'll leave it like this for now, so that you can chime in if there is anything else you'd like to update…

@chrisdavidmills, all looks good to me -- thanks for the help!

@chrisdavidmills
Copy link
Contributor

I'll leave it like this for now, so that you can chime in if there is anything else you'd like to update…

@chrisdavidmills, all looks good to me -- thanks for the help!

Perfect, thanks again @nwhittaker!

@chrisdavidmills chrisdavidmills merged commit 1582d17 into mdn:main Jan 27, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants