Screen/Window size changes after navigator.share close dialog on ios

Hello, I found a very strange issue, I am not sure it is Cordova issue or ios or the F7.

I am using Vue base setup of F7.

I am trying to create a native share dialog using the navigator.share, which is working good.
but when I try to share it via message or whatsapp, when native share dialog close App window size change and view collapse.

  const shareURL = 'https://google.com';
  let self = this;

  console.log(this.$f7.width);  
  // original width before share is 414
  console.log(this.$f7.height); 
  // original height before share is 852

  navigator.share({
    title: this.getUser.first_name + " " + this.getUser.last_name + " Resume",
    text: this.getUser.first_name + " " + this.getUser.last_name + " Resume",
    url: shareURL
  }).then(() => {

  console.log(this.$f7.width);  
  // changed width after share is 458
  console.log(this.$f7.height); 
  // changed height after share is 943

 //solution to get back to original size of screen 
  setTimeout(() => {
      self.$f7.$(window).trigger('resize');
      
    }, 2000);
  }).catch((err) => {
    document.body.style.height = '';
    console.error("Share failed:", err.message);
    self.$f7.$(window).trigger('resize');
  });

I also found when I tap on the input it gets back to normal screen size.

I have attached the video here

Вам нужно поставить плагин клавиатуры от ionic вместо стандартного, посмотрите мою тему про Фотопланету, там написано подробно как это сделать

Hey @shastox, Thanks for the reply but can you please share the link for the post? as I didn’t understand the Russian, I tried to search Фотопланету and Photoplanet in the forum search, but I didn’t find any article.

Thank you! Looking forward to your reply.

  1. Заменить плагин клавиатуры на cordova-plugin-ionic-keyboard
  2. Внести изменения в https://github.com/framework7io/framework7-cli/blob/master/create-app/templates/common/cordova-app.js в этой строке

if (!window.Keyboard || !window.Keyboard.shrinkView || f7.device.electron) return;

убираем проверку на shrinkView, в итоге получим:

if (!window.Keyboard || f7.device.electron) return;

а также убираем две строчки:

window.Keyboard.shrinkView(false);
window.Keyboard.disableScrollingInShrinkView(true);

  1. В config.xml добавляем строку для iOS платформы:

<preference name="KeyboardResize" value="body" />

1 Like

@shastox Thank you so much for the help, it works!