primefaces / primefaces/primereact
Dropdown: message triggered by "required" property is mispositioned
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When the "required" property of the Dropdown component is used, the Dropdown is not filled, and validation is triggered, the error message that results is incorrectly positioned (the hidden select seems itself not well placed and "too invisible" for the browser to find it).
Reproducer
https://codesandbox.io/s/elated-feather-13b4fm?file=/src/demo/DropdownDemo.js
PrimeReact version
8.0.1
React version
18.x
Language
ALL
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
- Submit the first form
- See error message appear on the top-left corner of the viewport
- Open the dialog and submit the second form
- See error message in same erroneous position
Expected behavior
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproducer and the Dropdown component's required-field validation behavior. Compare the first form with the dialog form, inspect how the hidden select is positioned, and confirm that validation messages no longer appear at the viewport's top-left corner in either case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100