TieredMenu show method nevers shows menu when called directly #1493

Merged
merged 4 commits into from Dec 7, 2016

Projects

None yet

2 participants

@mmikeyy
Contributor
mmikeyy commented Dec 4, 2016

It shows the menu only when called indirectly via the toggle method.

When show is called directly, preventDocumentDefault is never set to true, therefore the menu is closed by the event listener attached to the body in the same cycle that the show method attempts to show it. So it remains hidden.

mmikeyy added some commits Nov 12, 2016
@mmikeyy mmikeyy spinner crashes angular in dev mode
This solves a problem when angular is run in dev mode under the following conditions:
- spinner is in a reactive form;
- spinner's initial value is not null or empty string (some numeric value)
- spinner control's inclusion in template is conditional (within element with *ngIf attribute)
Problem: angular crashes whenever the control is hidden, then displayed. 
Reason: angular reports that a value was changed after it was checked. 

The timeout proposed eliminates the error with no side effect that I could detect.
b7cf302
@mmikeyy mmikeyy Merge pull request #1 from mmikeyy/mmikeyy-patch-spinner
spinner crashes angular in dev mode
40ae7c9
@mmikeyy mmikeyy TieredMenu show method nevers shows menu
Setting preventDocumentDefault = true is what stops the mouse click meant to open the menu from immediately closing it.

However this property is set only when the menu is opened via the toggle method.

When show is called directly, the menu is at the same time opened by the show method, and closed by the event listener on the body.
91fd6bf
@mmikeyy mmikeyy Update spinner.ts a9aaaa5
@cagataycivici cagataycivici added this to the 1.0.2 milestone Dec 7, 2016
@cagataycivici cagataycivici self-assigned this Dec 7, 2016
@cagataycivici cagataycivici added defect and removed enhancement labels Dec 7, 2016
@cagataycivici cagataycivici merged commit d75cc66 into primefaces:master Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment