triniwiz / nativescript-toasty

:bread: NativeScript toast plugin :bread:
Other
44 stars 21 forks source link

NS 6: topmost() is deprecated. Use Frame.topmost() instead. #32

Open razorsyntax opened 5 years ago

razorsyntax commented 5 years ago

Looks like NS 6 is writing the warning topmost() is deprecated. Use Frame.topmost() instead. in the console.

Changing frameModule.topmost() to frameModule.Frame.topmost() should fix this.

kefahB commented 4 years ago

Hi,

I edited the source code on ios and do the change with Frame.topmost() but the msg dose not show up ! the app dose not crash anymore...

I did some test to fix the issue but is not easy .. the msg it will show up if you passe an anchor to Toasty options BUT not a page or a Gridlayout ! the Button and his parent .. it dose not work with Frame.topmost().currentPage.ios for example !


public pay(args: EventData) 
    {
        const view: View = args.object as View;
        const grid: Page = view.page.getViewById('home-grid');
        let anchor = isIOS ? grid.ios : grid.android; // dose not work
        const toasty = new Toasty({
        text: 'Somethign something...',
        yAxisOffset: 100,
        xAxisOffset: 10,
        ios: {
          displayShadow: true,
          shadowColor: '#fff000',
          cornerRadius: 24
        },
        anchorView: view.ios, // this work fine !
      });

      toasty.show();
}
aquinn637 commented 4 years ago

I'm getting the same issue. file:///node_modules/@nativescript/core/ui/frame/frame-common.js:580:0: topmost() is deprecated. Use Frame.topmost() instead.

But the plugin is still working with this warning here.

vivek-aecor commented 4 years ago

same here error showing

file:///node_modules/@nativescript/core/ui/frame/frame-common.js:581:16: 'topmost() is deprecated. Use Frame.topmost() instead.'

bradmartin commented 4 years ago

Will be closed with 4.0.0 release when NS7 is released.

khoihuynhInfo commented 4 years ago

NativeScript >= 6.5 You can use,

import { Frame } from "@nativescript/core";

I usually using for dismissSoftKeyboard on IOS platform, example: Frame.topmost().nativeView.endEditing(true); It worked with me !