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,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, ElementRef } from '@angular/core';
|
||||
import { WidgetComponent } from './../widget.component';
|
||||
|
||||
declare let __moduleName: string;
|
||||
declare var componentHandler;
|
||||
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
@@ -29,4 +28,25 @@ declare var componentHandler;
|
||||
})
|
||||
export class TextWidget extends WidgetComponent {
|
||||
|
||||
constructor(private elementRef: ElementRef) {
|
||||
super();
|
||||
}
|
||||
|
||||
setupMaterialComponents(componentHandler: any): boolean {
|
||||
// workaround for MDL issues with dynamic components
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
if (this.elementRef && this.hasValue()) {
|
||||
let el = this.elementRef.nativeElement;
|
||||
let container = el.querySelector('.mdl-textfield');
|
||||
if (container) {
|
||||
container.MaterialTextfield.change(this.field.value);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user