Search code examples
androidkendo-uihybrid-mobile-apptelerik-appbuilder

Can't scroll to top on Android on long form after number-pad is opened (and then closed) in Telerik AppBuilder Icenium Hybrid Cordova


I am building a Telerik AppBuilder Icenium Hybrid Cordova application and I have a view (an HTML page with a div) that has some content. The view is longer than the device so I have to scroll down "below the fold" to complete the form. However, I have noticed that if, on the form, I have an input where the type is "number" (which opens the number pad) and I enter a number, and close the number pad, then try to scroll to the top, I can't any more.

Here is the markup: (this markup is nothing special, but this is the actual markup, and let's say I scroll to the bottom and complete the form from the bottom up, and I populate the dates (at the very bottom) and I go up and then populate the "times per WI" - for example - then I try to scroll to the top, and I can't; however I can scroll below the lowest point of the view an amount equal to the size of the actual number-pad itself. (its like, once I toggle the number-pad it manipulates the screen scrollable max-height or something.

    <style>
    .bodyPartImg img {
        width: 50px;
        height: 50px;
    }
</style>
<div data-role="view"
     data-title="Workout Type Rules"
     data-layout="main"
     data-model="app.workoutTypeRule"
     data-show="app.workoutTypeRule.onShow"
     data-after-show="app.workoutTypeRule.afterShow">

    <div class="container">
        <div class="row">
            <div class="col-sm-4">
                <h2 style="font-weight: bolder;">Choose Workout Type</h2>
            </div>
            <div class="col-sm-8">
                <select class="form-control sel_workoutTypes"></select>
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">Should this activity focus on <u>multiple body parts</u>?</h2>
            </div>
            <div class="col-xs-4">
                <input type="checkbox" name="multipleBodyParts" checked>
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-sm-4">
                <!-- Should this activity focus on multiple body parts -->
                <h2 style="font-weight: bolder;">Choose Bodypart(s)</h2>
            </div>
            <div class="col-sm-8">
                <a id="bodyPartImg_abs" class="bodyPartImg"><img src="images/abs.png" /></a>
                <a id="bodyPartImg_arms" class="bodyPartImg"><img src="images/arm.png" /></a>
                <a id="bodyPartImg_back" class="bodyPartImg"><img src="images/back.png" /></a>
                <a id="bodyPartImg_chest" class="bodyPartImg"><img src="images/chest.png" /></a>
                <a id="bodyPartImg_legs" class="bodyPartImg"><img src="images/leg.png" /></a>
                <a id="bodyPartImg_shoulders" class="bodyPartImg"><img src="images/shoulder.png" /></a>
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">
                Minimum Sets
                </h2>
            </div>
            <div class="col-xs-4">
                <input type="number" class="form-control" name="min_sets" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">
                Minimum Reps
                </h2>
            </div>
            <div class="col-xs-4">
                <input type="number" class="form-control" name="min_reps" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">
                Minimum Weight
                </h2>
            </div>
            <div class="col-xs-4">
                <input type="number" class="form-control" name="min_weight" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">
                Minimum Bodypart Impact
                </h2>
            </div>
            <div class="col-xs-4">
                <input type="number" class="form-control" name="min_bodyPartImpact" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">
                Minimum Duration
                </h2>
            </div>
            <div class="col-xs-4">
                <input type="range" class="form-control" name="min_bodyPartImpact" min="0" max="10" />
                <input type="range" class="form-control" name="min_bodyPartImpact" min="0" max="60" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">See details?</h2>
            </div>
            <div class="col-xs-4">
                <input type="checkbox" name="seeDetails" checked>
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-8">
                <h2 style="font-weight: bolder;">
                Times Per Workout Interval (WI)?
                </h2>
            </div>
            <div class="col-xs-4">
                <input type="number" class="form-control" name="timePerWI" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-6">
                <h2 style="font-weight: bolder;">
                Start Date
                </h2>
            </div>
            <div class="col-xs-6">
                <input type="date" class="form-control" name="startDate" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-xs-6">
                <h2 style="font-weight: bolder;">
                End Date
                </h2>
            </div>
            <div class="col-xs-6">
                <input type="date" class="form-control" name="endDate" />
            </div>
        </div>
    </div>

</div>

Solution

  • The answer is

    data-use-native-scrolling="true"> 
    

    see at the bottom

    <div data-role="view"
         data-title="Workout Type Rules"
         data-layout="main"
         data-model="app.workoutTypeRule"
         data-show="app.workoutTypeRule.onShow"
         data-after-show="app.workoutTypeRule.afterShow"
         data-use-native-scrolling="true">