plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[@nativescript/iqkeyboardmanager] Keyboard overlap after typing in text view on bottom of page

Open fpaaske opened this issue 5 years ago • 7 comments

I think the issue is described quite well here:

https://github.com/tjvantoll/nativescript-IQKeyboardManager/issues/42 https://github.com/tjvantoll/nativescript-IQKeyboardManager/issues/54 https://github.com/tjvantoll/nativescript-IQKeyboardManager/issues/69

It has a temporary workaround as mentioned here, but wrapping in scollview is not always possible.

Hopefully this can be fixed for NS 6 and 7.

fpaaske avatar Nov 12 '20 09:11 fpaaske

When is this going to be merged?

SmailHammour avatar Mar 22 '21 15:03 SmailHammour

@SmailHammour I can't see a pending PR, mind linking the one you are referring to?

rigor789 avatar Mar 22 '21 22:03 rigor789

I have this issue on 3 projects, and it's really shit.

SergioZhydecky avatar Apr 28 '21 07:04 SergioZhydecky

Is this ever going to be fixed? it's been 7 months.

HamzaHusain avatar Jun 12 '21 20:06 HamzaHusain

if anyone is waiting - this stack overflow seemed to help me for ios. When i had a radlistview or listview and a textfield with IQKeyboardManager. Any text input on the textfield would make the textfield "go behind" the keyboard. The following code will ensure that the keyboard will always be under the textfield of interest.

component.html

<GridLayout rows="*,auto">

    <RadListView row=0>
        // ... your own impl
    </RadListView>

    <TextView 
        row=0 
        (loaded)="onTextLoaded($event)" 
        autocorrect="true" 
        class="x-message p-x-4" 
        hint="Aa"
        [text]="message" 
        (textChange)="onTextChange($event)"  
        textWrap="true" 
        fontSize=12
    ></TextView>

</GridLayout>

component.ts

    onTextLoaded(args) {
        const textView = args.object as TextView;

        textView.requestLayout = function () {
            if (
                !arguments[0] &&
                this.nativeViewProtected &&
                this.nativeViewProtected.isFirstResponder
            ) {
                this.nativeViewProtected.setNeedsLayout();
                IQKeyboardManager.sharedManager().reloadLayoutIfNeeded();
            } else {
                View.prototype.requestLayout.call(this);
            }
        };
    }

Note: The code above wont make the top of the listview show at the top of the view port of the screen. It will just put the textfield and the content above the textfield above the keyboard.

https://stackoverflow.com/questions/61801857/nativescript-chat-ui-ios-issues

pekevski avatar Jul 16 '21 07:07 pekevski

I have encountered a similar problem, I have a form that when completed changes a color button (disabled->enabled) and when this color button is updated it causes it to lose the fields from the view. When I have embed my view in a ScrollView it seems to work fine

vallemar avatar Feb 21 '23 20:02 vallemar