choojs / choojs/nanomorph

Range element min + max attributes must come before value attribute

Open
#124 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
751
Forks
57
PR merge metrics
No merged PRs in 30d

Description

For posterity: for a range element with custom min/max attributes, make sure those attributes come *before* the value attribute on the input. E.g.:

This
```

```

Not this
```

```

This is because the DOM truncates the `value` attribute to 100 if there is not already a custom `max` attribute during [copyAttrs](https://github.com/choojs/nanomorph/blob/master/lib/morph.js#L35).

Maybe a fix would be for copyAttrs to be aware of this dependency and explicitly copy over `min` + `max` before `value`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.