This is a migrated thread and some comments may be shown as answers.

Popup on NumericTextBox error

3 Answers 553 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Glenn Boothe
Top achievements
Rank 1
Glenn Boothe asked on 31 Jan 2018, 12:47 AM

I get this error:

TypeError: element.getBoundingClientRect is not a function

When trying to show a popup on a numeric text box. Please see my Plunker

https://plnkr.co/edit/yiFG7JrF49vEVJspCmiG?p=preview

Am I doing something wrong or is this a bug?

3 Answers, 1 is accepted

Sort by
0
Glenn Boothe
Top achievements
Rank 1
answered on 31 Jan 2018, 01:00 AM

It looks like I get the same results with any kendo input. I've tried drop down list and date picker. My work around for now is to add an empty span between them.

 

<kendo-numerictextbox formControlName="count"></kendo-numerictextbox>
<span #countValid></span>
<kendo-popup [anchor]="countValid" *ngIf="!editFormGroup.controls.count.valid && !editFormGroup.controls.count.pristine">
    Count is required
</kendo-popup>
0
Accepted
Georgi Krustev
Telerik team
answered on 31 Jan 2018, 09:32 AM
Hi Glenn,

By default, the Angular compiler will select the NumericTextBox component from the element, but the Popup `anchor` property expects an ElementRef instance. That being said, you will need to instruct the compiler to select the proper element using the `read` configuration. Check the modified plunker:

https://plnkr.co/edit/XlQMOXBCD9eqT7Nty7no?p=preview

Regards,
Georgi Krustev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
IT AE
Top achievements
Rank 1
answered on 01 Mar 2018, 10:11 AM

Using numericInput should work, too:

<kendo-numerictextbox #countValid formControlName="count"></kendo-numerictextbox>
<kendo-popup [anchor]="countValid.numericInput" *ngIf="!editFormGroup.controls.count.valid && !editFormGroup.controls.count.pristine">
    Count is required
</kendo-popup>

 

Tags
General Discussions
Asked by
Glenn Boothe
Top achievements
Rank 1
Answers by
Glenn Boothe
Top achievements
Rank 1
Georgi Krustev
Telerik team
IT AE
Top achievements
Rank 1
Share this question
or