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

InputNumber: missing data attribute #3321

Closed
x3igh7 opened this issue Sep 14, 2022 · 2 comments · Fixed by #3322
Closed

InputNumber: missing data attribute #3321

x3igh7 opened this issue Sep 14, 2022 · 2 comments · Fixed by #3322
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@x3igh7
Copy link

x3igh7 commented Sep 14, 2022

Describe the bug

InputNumber component does not properly pass down the data attribute as expected per #2620

<span id="76" class="p-inputnumber p-component p-inputwrapper p-invalid" data-id="76">
    <input role="spinbutton" class="p-inputtext p-component p-filled p-inputnumber-input" type="text" inputmode="numeric" name="76" value="" aria-valuenow="100">
</span>

The data attribute is on the parent span element instead.

Reproducer

No response

PrimeReact version

8.5.0

React version

17.x

Language

ES6

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

Expected is that the data attribute is on the input element so that it can be easily accessed via the change event. Other Prime Input elements behave in this fashion.

@x3igh7 x3igh7 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 14, 2022
@x3igh7 x3igh7 changed the title Component: InputNumber InputNumber: missing data attribute Sep 14, 2022
@x3igh7
Copy link
Author

x3igh7 commented Sep 14, 2022

Work around is to access the parentElement like:

e.originalEvent.currentTarget.parentElement?.getAttribute('data-id')

melloware added a commit to melloware/primereact that referenced this issue Sep 14, 2022
melloware added a commit to melloware/primereact that referenced this issue Sep 14, 2022
@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 14, 2022
@melloware melloware self-assigned this Sep 14, 2022
@melloware melloware added this to the 8.6.0 milestone Sep 14, 2022
@melloware
Copy link
Member

melloware commented Sep 14, 2022

Please review my PR I am now passing all "data" attributes to the internal INPUT component of

  • AutoComplete
  • Dropdown
  • InputNumber
  • InputSwitch
  • MultiSelect
  • RadioButton
  • Checkbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants