primefaces / primefaces/primereact

InputNumber: The 'max' attribute is not allowed for this input 'type'

Open
#8,290 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

The InputNumber component fails accessibility requirements, when a max range is provided. The input element with type="text" should not have max attribute.

Not sure if this is fixable without some bigger adjustments, as from what I can see this component is based on the text input.

Reproducer

No response

System Information
primereact: 10.9.7
Steps to reproduce the behavior
  1. Go to https://primereact.org/inputnumber/
  2. Inspect the input element with max value defined
  3. Notice that the input has type="text" and max attribute
Expected behavior

Input should be of a different type e.g. number or the max attribute should not be defined on the element.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the InputNumber component as demonstrated on the inputnumber documentation page, and inspect the rendered input when a max value is provided. Confirm the resulting element satisfies the reported accessibility requirement by using an appropriate input type or omitting the invalid max attribute.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.