mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#814 fix MDL issues
- additional workarounds for Material Design Lite problems - validation fixes fixes #814
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, ElementRef } from '@angular/core';
|
||||
import { WidgetComponent } from './../widget.component';
|
||||
import { FormService } from '../../../services/form.service';
|
||||
import { GroupModel } from './../core/group.model';
|
||||
@@ -36,7 +36,8 @@ export class FunctionalGroupWidget extends WidgetComponent implements OnInit {
|
||||
minTermLength: number = 1;
|
||||
groupId: string;
|
||||
|
||||
constructor(private formService: FormService) {
|
||||
constructor(private formService: FormService,
|
||||
private elementRef: ElementRef) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -108,4 +109,19 @@ export class FunctionalGroupWidget extends WidgetComponent implements OnInit {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
setupMaterialComponents(handler: any): boolean {
|
||||
// workaround for MDL issues with dynamic components
|
||||
if (handler) {
|
||||
handler.upgradeAllRegistered();
|
||||
if (this.elementRef && this.value) {
|
||||
let container = this.elementRef.nativeElement.querySelector('.mdl-textfield');
|
||||
if (container) {
|
||||
container.MaterialTextfield.change(this.value);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user