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(#15241): removed invalid transforms on Inputs #15243

Conversation

BGBRWR
Copy link
Contributor

@BGBRWR BGBRWR commented Apr 9, 2024

Currently setting expandedRowKeys or editingRowKeys with anything will convert them to booleans; Which is the wrong type and breaks working with these inputs.

Fixes #15241 #15264

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Apr 18, 2024 9:20am

@BGBRWR
Copy link
Contributor Author

BGBRWR commented Apr 9, 2024

This breaking bug was introduce in v17.13.0 via #14646 by @LcsGa.

@LcsGa
Copy link
Contributor

LcsGa commented Apr 9, 2024

That might not be the only mistake actually.
There are so many modified lines, it seems like I also made similar mistakes elsewhere (on trackBy input functions for exemple).

@LcsGa
Copy link
Contributor

LcsGa commented Apr 9, 2024

I'll take a look at it asap to provide a fix (if nobody did it already).

@Viktor-Ivliev
Copy link

That might not be the only mistake actually. There are so many modified lines, it seems like I also made similar mistakes elsewhere (on trackBy input functions for exemple).

I think it so #15241 trackBy really does not work =(

@LcsGa
Copy link
Contributor

LcsGa commented Apr 10, 2024

That might not be the only mistake actually. There are so many modified lines, it seems like I also made similar mistakes elsewhere (on trackBy input functions for exemple).

I think it so #15241 trackBy really does not work =(

Yep, my bad 😓, I'll remove the transforms asap, where it broke things

@BGBRWR
Copy link
Contributor Author

BGBRWR commented Apr 10, 2024

I added the remaining fixes to all invalid transform Inputs. It ended up including the same changes in the PR #15248.

@LcsGa
Copy link
Contributor

LcsGa commented Apr 10, 2024

Great! I'll close mine then

@BGBRWR BGBRWR changed the title fix(table): removed invalid transforms on Inputs fix(#15241): removed invalid transforms on Inputs Apr 11, 2024
@BGBRWR
Copy link
Contributor Author

BGBRWR commented Apr 11, 2024

fixes #15241

Copy link

@aaronsalazar aaronsalazar left a comment

Choose a reason for hiding this comment

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

👍

@LcsGa
Copy link
Contributor

LcsGa commented Apr 13, 2024

About the last commit, why not simply make a specific transform function instead of completely removing it, as it could increase the DX?

@PaulSchult
Copy link

About the last commit, why not simply make a specific transform function instead of completely removing it, as it could increase the DX?

Do you mean something similar to what I suggested in #15264?

Just curious, how do the input transforms enhance the DX?

@LcsGa
Copy link
Contributor

LcsGa commented Apr 14, 2024

About the last commit, why not simply make a specific transform function instead of completely removing it, as it could increase the DX?

Do you mean something similar to what I suggested in #15264?

Just curious, how do the input transforms enhance the DX?

Yes, exactly!
Well, if you know exactly what value you want to pass and it's not meant to be dynamic, you can do things like this thanks to them:

<!-- before -->
<p-inputnumber [minFractionDigit]="2">

<p-button [rounded]="true">

<!-- after -->
<p-inputnumber minFractionDigit="2">

<p-button rounded>

As you can see, especially with boolean "flags", it is less code to write and this is one good way for using input transforms.

Before that transform function, a lot of libraries already provided such things using setters and now it is just easier.

@BGBRWR
Copy link
Contributor Author

BGBRWR commented Apr 15, 2024

I agree but I won't have time to add this improvement. The purpose of this PR is to get this library back to a working state. If this PR is still open a week from now I can try to add custom transforms on InputNumber's minFractionDigit/maxFractionDigit.

@PaulSchult
Copy link

I agree but I won't have time to add this improvement. The purpose of this PR is to get this library back to a working state. If this PR is still open a week from now I can try to add custom transforms on InputNumber's minFractionDigit/maxFractionDigit.

Reopened #15264 and opened #15275 as well

@cetincakiroglu cetincakiroglu merged commit 96e657c into primefaces:master Apr 18, 2024
2 of 3 checks passed
@cetincakiroglu
Copy link
Contributor

Hi @BGBRWR,

Thanks a lot for the effort and support!

@BGBRWR BGBRWR deleted the expandedRowKeys-is-getting-set-to-a-boolean branch July 23, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component: P-Table does work correctly with [rowTrackBy] for 17.13.0 version
6 participants