Closed brian-avery closed 7 years ago
Hi,
I've implemented focus
and blur
events in the @next
version
npm install ng2-codemirror@next
@chymz Besides the blur
and focus
events, the other events that are supported by codemirror should be implemented. I currently need to use the keyup
event for my project. Could this be added into ng2-codemirror soon?
@chymz For now, I am using the ViewChild
decorator to access the codemirror instance directly to add the events I need (which is not the ideal way) pending the addition of the other events.
I tried to use blur, which is listed on http://codemirror.net/doc/manual.html#events to detect when the focus is lost on the codemirror object, but my function doesn't get called. Here's a sample:
<codemirror [(ngModel)]="code" name="code" [config]="config" (blur)="focusLost()">
focusLost() { console.log("Focus lost") }
But the blur event never fires. Is this not bubbled up through the component?
Thanks, Brian