onFocus for Calendar #1766

Closed
variable-content opened this Issue Jan 9, 2017 · 3 comments

Projects

None yet

3 participants

@variable-content
variable-content commented Jan 9, 2017 edited

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

[ ] bug report => Search github for a similar issue or PR before submitting
[X] 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
Unable to elegantly react to focus event on the calendar input field. I have a wrapping component that needs to change its display when the calendar's input field gains focus. Currently need to use something like renderer.listen(hostEl.nativeElement.querySelector('p-calendar input'), 'focus'... to achieve this.
This component already as an onBlur event, would be nice to include onFocus for parity.

Expected behavior
<p-calendar
[(ngModel)]="value"
(onBlur)="onBlur($event)"
(onFocus)="onFocus($event)">

What is the motivation / use case for changing the behavior?
See above.

  • PrimeNG version: 1.1.4
@Mrtcndkn
Contributor

It already has you can just use it like that

@variable-content

Sorry, logged a few issues yesterday, this was supposed to about the Calendar, not the Dropdown, will update the issue to reflect this.

@variable-content variable-content changed the title from Add onFocus event emitter to dropdown component to Add onFocus event emitter to Calendar component Jan 10, 2017
@cagataycivici cagataycivici added this to the 2.0 milestone Jan 11, 2017
@cagataycivici cagataycivici self-assigned this Jan 11, 2017
@cagataycivici cagataycivici changed the title from Add onFocus event emitter to Calendar component to onFocus for Calendar Jan 11, 2017
@variable-content

Thanks @cagataycivici for getting this merged!

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