primeng icon indicating copy to clipboard operation
primeng copied to clipboard

selectOtherMonths is broken in multiple and range mode

Open azizparmaksiz opened this issue 7 years ago • 3 comments

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

PrimeNG version:** 8.1.0

Hi, I am using p-calendar with [selectOtherMonths]="true" [showOtherMonths]="true" selectionMode="range" properties. And when calendar dialog opened as image

While I was picking the first date from other months value the calendar dialog is closed before I select the second date.

azizparmaksiz avatar Nov 25 '19 07:11 azizparmaksiz

The issue I found in the code is the following: Whenever we click even in a date range selection mode, we enter in this method bindDocumentClickListener and proceed with the call of hideOverlay() because the condition if (_this.isOutsideClicked(event) && _this.overlayVisible) { ... } is truthy whereas it should not.

Actually, looking at the method isOutsideClicked, the first statement checked is !(this.el.nativeElement.isSameNode(event.target). We clearly see the negation of the same node comparison will return true, which is wrong. So, removing the negative operator could help fixing the issue.

minato-namikaze avatar Dec 04 '19 14:12 minato-namikaze

I am also experiencing this issue.

zacharyfox avatar Mar 10 '20 15:03 zacharyfox

Same issue for me.

neergaard79 avatar Mar 16 '20 19:03 neergaard79