Skip to content

Commit

Permalink
chore: native focus/blur usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerCodeMonkey committed Sep 22, 2023
1 parent 1cb4689 commit bb63fb5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
"katex": "^0.16.7",
"ngx-quill": "^22.0.0",
"ngx-quill": "^22.1.0-beta.2",
"quill": "^1.3.7",
"quill-emoji": "^0.2.0",
"quill-image-resize-module": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app/default/default.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h3 id="focusBlur">Default editor with height of 200px</h3>
<p>focused: {{ focused }}, blurred: {{ blurred }}</p>
<quill-editor [styles]="{height: '200px'}" (onFocus)="focus($event)" (onEditorChanged)="changedEditor($event)" (onBlur)="blur($event)" (onEditorCreated)="created($event)"></quill-editor>
<quill-editor [styles]="{height: '200px'}" (onFocus)="focus($event)" (onNativeFocus)="nativeFocus($event)" (onEditorChanged)="changedEditor($event)" (onBlur)="blur($event)" (onNativeBlur)="nativeBlur($event)" (onEditorCreated)="created($event)"></quill-editor>

<h4>Material Quill</h4>

<mat-form-field appearance="fill">
<mat-quill [styles]="{height: '200px'}" (onFocus)="focus($event)" (onEditorChanged)="changedEditor($event)" (onBlur)="blur($event)" (onEditorCreated)="created($event)"></mat-quill>
<mat-quill [styles]="{height: '200px'}" (onFocus)="focus($event)" (onNativeFocus)="nativeFocus($event)" (onEditorChanged)="changedEditor($event)" (onBlur)="blur($event)" (onNativeBlur)="nativeBlur($event)" (onEditorCreated)="created($event)"></mat-quill>
</mat-form-field>
8 changes: 8 additions & 0 deletions src/app/default/default.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,19 @@ export class DefaultComponent {
this.focused = true
this.blurred = false
}
nativeFocus($event) {
// tslint:disable-next-line:no-console
console.log('native-focus', $event)
}

blur($event) {
// tslint:disable-next-line:no-console
console.log('blur', $event)
this.focused = false
this.blurred = true
}
nativeBlur($event) {
// tslint:disable-next-line:no-console
console.log('native-blur', $event)
}
}

0 comments on commit bb63fb5

Please sign in to comment.