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
Copy and Paste support for KeyFilter #4850
Comments
Not sure, it throws validation error in validate mode though. |
Why not listen to the paste Event? |
Old issue that was probably fixed at some point but seems to have broken again. I get this issue migrating from primeng 6.1.5 to 7.1.0-rc.1. Copy and paste into a key filter for numbers previously worked. |
I'm not able to paste invalid test in when using pValidateOnly. IMO, this code should quit early if pValidateOnly so the application can appropriately handle in invalid pasted text.
|
So this is the current version of the code:
There's two problems with this implementation: It is not actually comparing the text and it is only finding the existence of one value within the whole string. This leads to two issues, pasting in integer fields does not work at all and this allows for pasting characters that dont belong (special characters or numbers) into fields set to alpha or alphanumeric.
To fix this we can do:
After making both those changes, the paste function will work as expected. Full code after changes:
|
I think this should be the correct solution @JACrazy, I removed
|
@cagataycivici I've been pushing for a while, this issue still exists. The fix done for #7729 does not fix validations done on the pasted text. It allows text to be pasted but the problem with the way regex testing is being done, allows for strings to be pasted into integer only fields as long as one character in the string is a number. See this example from https://www.primefaces.org/primeng/#/keyfilter |
This issue still actual. 😔 PrimeNG version: 9.0.6 The code fragment to reproduce:
|
Looks like they finally fixed this in 9.1.0. They went for a different approach which is to go through each character one by one and verify rather than doing one regex test over the whole text.
|
I'm still not able to paste any values for a regex keyFilter. Just refer to the following example using regex for filtering of an IP address: When trying to paste any valid value like "127.0.0.1" nothing happens at all. Btw. you can also take a look at the official primeNG page for keyFilter: Angular: 13.3.4 |
Hi, So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Best Regards, |
@mertsincan |
I upgraded my project to ng15 with primeng 15.0.0-rc.1 and the problem still exists, so I'm opening a new issue - maybe we can get help this way. # |
I used keyfilter component for my number input field but can not handle in the case user copy and paste a string inside? Is there the way to handle copy and paste action to check the correct input data, like an event fired for ex ?
The text was updated successfully, but these errors were encountered: