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

inputText - KeyFilter: No copy-paste performed in Firefox #3785

Closed
alberto-marin-garcia opened this Issue Jun 15, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@alberto-marin-garcia
Copy link

alberto-marin-garcia commented Jun 15, 2018

Example:

<p:inputText id="filterCommandeNumber" value="#{afrTrackingOTMB.filter.orderNumber}" size="16" maxlength="12">
<p:keyFilter mask="pint" preventPaste="false"/>
</p:inputText>

PrimeFaces version: 6.1.15

Neither CTRL-V or right mouse click + paste actions performed into TextBox

@tandraschko

This comment has been minimized.

Copy link
Member

tandraschko commented Jun 15, 2018

Please respect our issue template or it will be closed.

@tandraschko tandraschko added the invalid label Jun 15, 2018

@melloware

This comment has been minimized.

Copy link
Contributor

melloware commented Jun 15, 2018

Just tested this little sample and Paste is working fine for me both right click and CTRL+V. Tested on 6.2 and 6.3-SNAPSHOT.

<p:inputText  size="16" maxlength="12">
       <p:keyFilter mask="pint" preventPaste="false"/>
</p:inputText>
@alberto-marin-garcia

This comment has been minimized.

Copy link

alberto-marin-garcia commented Jun 20, 2018

Thanks melloware, tested on Chrome, it works, but is not working in Mozilla !

@melloware

This comment has been minimized.

Copy link
Contributor

melloware commented Jun 20, 2018

So can you please update the ticket title to say "KeyFilter: No copy-paste performed in Firefox"

@alberto-marin-garcia alberto-marin-garcia changed the title inputText - KeyFilter: No copy-paste performed inputText - KeyFilter: No copy-paste performed in Firefox Jun 20, 2018

@alberto-marin-garcia

This comment has been minimized.

Copy link

alberto-marin-garcia commented Jun 20, 2018

In keyfilter.js, keypress event is tested as this: if (n == 17 || n == 18) { ..
In primeface-extensions (old version) this works with Mozilla too: if (e.ctrlKey || e.altKey) { ...

@melloware

This comment has been minimized.

Copy link
Contributor

melloware commented Jun 20, 2018

I will investigate and fix. original code here looks like it is correct have to look and see why it was changed.

https://github.com/akzhan/jquery-keyfilter/blob/master/jquery.keyfilter.js

@melloware

This comment has been minimized.

Copy link
Contributor

melloware commented Jun 20, 2018

OK it looks like this was changed on purpose in this ticket:

#1852

I bet we need to do a browser detect.

@melloware

This comment has been minimized.

Copy link
Contributor

melloware commented Jun 20, 2018

Please review my fix: #3805

tandraschko added a commit that referenced this issue Jun 21, 2018

Merge pull request #3805 from melloware/PF3785
Fix #3785 and #3596: Keyfilter issues on Mozilla.

@tandraschko tandraschko added this to the 6.3 milestone Jun 21, 2018

@alberto-marin-garcia

This comment has been minimized.

Copy link

alberto-marin-garcia commented Jun 21, 2018

Thanks melloware for your support !!!

@mertsincan mertsincan added the 6.2.14 label Jan 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment