SelectOneMenu not filtering with paste #2946
Unanswered
crcatedr
asked this question in
PrimeFaces
Replies: 2 comments
-
Here is the code and you can see we are listening for bindFilterEvents: function() {
var $this = this;
this.filterInput.on('keyup.ui-selectonemenu', function(e) {
if (PrimeFaces.utils.ignoreFilterKey(e)) {
return;
}
var metaKey = e.metaKey||e.ctrlKey;
if(!metaKey) {
$this.filter($(this).val());
}
})
.on('keydown.ui-selectonemenu',function(e) {
switch(e.code) {
case 'ArrowUp':
$this.highlightPrev(e);
break;
case 'ArrowDown':
$this.highlightNext(e);
break;
case 'Enter':
case 'NumpadEnter':
case 'Tab':
$this.keyboardTarget.trigger("focus");
$this.keyboardTarget.trigger(jQuery.Event('keydown', { key: e.key, code: e.code }));
break;
case 'Escape':
$this.handleEscapeKey(e);
break;
case 'Space':
$this.handleSpaceKey(e);
break;
default:
break;
}
}).on('paste.ui-selectonemenu', function() {
PrimeFaces.queueTask(function(){
$this.filter($this.filterInput.val());
});
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Paste is working for me in Chrome? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
The SelectOneMenu filtering doesn't appear to be triggering on paste. It seems to be working in Firefox, but not in Chrome. I haven't tested other browsers.
The selectOneMenu I'm using looks something like this:
Any ideas how to get around this? Also, I noticed that filtering doesn't trigger if you drop a value into the input, and if possible I'd like to get that working as well. I've tried some javascript solutions to trigger change and keyup events on paste and input but it's not working. For reference, some of the things I've been trying look like this:
I'm using Primefaces 14.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions