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

KeyFilter is not working on pase #7729

Closed
shaileshyadav24 opened this issue May 23, 2019 · 5 comments
Closed

KeyFilter is not working on pase #7729

shaileshyadav24 opened this issue May 23, 2019 · 5 comments
Assignees
Labels
LTS-FIXED-7.1.5 Fixed in PrimeNG LTS 7.1.5 Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@shaileshyadav24
Copy link

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
Paste is not working

Expected behavior
Paste should work.

  • Angular version: 7.2

  • PrimeNG version: 7.1.3

Validated this code is not giving proper response:
@HostListener('paste', ['$event'])
onPaste(e) {
const clipboardData = e.clipboardData || (window).clipboardData.getData('text');
if (clipboardData) {
const pastedText = clipboardData;
if (!this.regex.test(pastedText)) {
e.preventDefault();
}
}

@JACrazy
Copy link

JACrazy commented Jun 4, 2019

Yes, the code is testing the clipboard data improperly. See my comment here for how this can be fixed

@yigitfindikli yigitfindikli added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jul 1, 2019
@yigitfindikli yigitfindikli self-assigned this Jul 1, 2019
@yigitfindikli yigitfindikli added this to the 8.0.1 milestone Jul 4, 2019
@cagataycivici cagataycivici changed the title KeyFilter is not working KeyFilter is not working on pase Jul 8, 2019
@JACrazy
Copy link

JACrazy commented Jul 8, 2019

That commit will still not fix the issue with properly validating the regex of the pasted text. It will allow illegal characters as long as one character exists that passes the regex.test().

@sonyshankar2k
Copy link

JACrazy, Have you tried it in prime ng 8.0.3? cagataycivici, Is this fixed in prime ng 8.0.3?

@JACrazy
Copy link

JACrazy commented Sep 10, 2019

I haven't tested on 8.0.3 but just by viewing the code that is on git, you can see it is still broken with validating pasting. The component hasnt been modified since 2 months ago.

@sonyshankar2k
Copy link

Thank you so much JACrazy

@yigitfindikli yigitfindikli added LTS-FIXED-8.1.2 Fixed in PrimeNG LTS 8.1.2 LTS-FIXED-7.1.5 Fixed in PrimeNG LTS 7.1.5 and removed LTS-FIXED-8.1.2 Fixed in PrimeNG LTS 8.1.2 labels Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-FIXED-7.1.5 Fixed in PrimeNG LTS 7.1.5 Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants