ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

WebView inside RadListView does not get selected #1381

Closed adityadi98 closed 4 years ago

adityadi98 commented 4 years ago

hello,

i am using RadListView to display a list of WebView elements which primarily has a text or image as it gets in the html format so while selecting (tap) on a webview element of a radlistview it does not get selected....

<RadListView [items]="questions[i].options" row="1" selectionBehavior="Press" (loaded)="radListLoaded($event)"
                            multipleSelection="false" backgroundColor="white" (itemSelected)="onItemSelected($event)">
                        <ng-template tkListItemTemplate let-option="item" let-i="index" let-isSelected="option.isSelected">

                            <CardView  style="margin: 7;" radius="5" backgroundColor="white" >        
                                    <GridLayout columns="*,5*" >
                                          <Label text=" {{questions[questionNumber].optionArray[i]}} "  column="0" style="text-align: center; font-size: 15;padding: 12;"  
                                               borderRightColor="{{selectedOptionBorderColor}}" borderRightWidth="1"></Label>
                            <GridLayout rows="*" columns="*" column="1">
                                <WebView column="1" (loadFinished)="onWebViewLoaded($event)" verticalAlignment="center" horizontalAlignment="center"
                                        textAlignment="center"  fontSize="20" 
                                        textWrap="true" 
                                        [src]="option" ></WebView>
                            </GridLayout>

                                   </GridLayout>
                            </CardView>
                        </ng-template>
                    </RadListView>

thanks, aditya m

NickIliev commented 4 years ago

@adityadi98 there are some invalid properties like column (it should be col). Also you are setting the WebVIew on the second col (with index 1) while there is only a single column (so it should be col="0" not column="1").

Those might not be related to your issue but I just wanted to let you know.

As for the selection - the WwebView is loading a content visualized inside a native WebView component and it has its own styling properties. So it might be expected that you won't be able to actually change the style of the whole webview. What you should probably do is to make sure that the content that is outside the WebView is triggering the selection (you could apply minimal padding to the GridLayout for example)