question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ion-list font size not working right on orientation change for iPhone

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior: I have 3 lists wrapped in swiper slides. On changing orientation from portrait to landscape font-size of ion-item in ion-list is increased. But on changing the orientation back to portrait still large font size is used.

Using swiper module https://github.com/nolimits4web/Swiper instead of ion-slide

Expected behavior: Font-size should come back to the right size on changing orientation.

Steps to reproduce:

Related code:

<div class="swiper-wrapper">
            <div class="swiper-slide imagery-swiper">
                  <ion-searchbar @ionInput="filterAvwx = $event.target.value"></ion-searchbar>
                  <ion-list>
                          <ion-item v-for="(tab, tabindex) in filteredItems" :key="tabindex" class="item-icon-right" v-on:click="selectTab(tab)" v-if="tab.t && (tab.c || tab.i)">
                              <ion-label>
                                  <span v-html="highlight(tab, filterAvwx)"></span>
                              </ion-label>
                              <ion-icon name="arrow-forward" slot="end" mode="ios" v-if="tab.c"></ion-icon>
                          </ion-item>
                      </ion-list>
            </div>
            <div class="swiper-slide  imagery-swiper">
                <ion-list>
                  <ion-item v-for="(subtabgroup, subtabgroupindex) in avwxServiceRef.selectedTab.c" :key="subtabgroupindex" v-show="subtabgroup.t" class="item-icon-right" v-on:click="selectSubtabGroup(subtabgroup)">
                            <ion-label>
                                <span v-html="highlight(subtabgroup, filterAvwx)"></span>
                            </ion-label>
                            <ion-icon name="arrow-forward" mode="ios" slot="end" v-if="subtabgroup.c"></ion-icon>
                        </ion-item>
                </ion-list>
            </div>
</div>

Other information: Maybe this is because I am wrapping ion-list inside swiper module, but why would using swiper div has any effect on font-size of ion-list.

  1. Initially it looks ike this in landcape image 6

  2. On moving it to Portrait fontsize increases as desired. image 4

  3. Changing back to landscape. image 5

Ionic info:

"@ionic/core": "4.0.0-rc.0",
		"@ionic/vue": "0.0.1",

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
schontzcommented, Oct 15, 2019

StackOverflow to the rescue:

html {
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape while allowing user zoom */
}
1reaction
stripathixcommented, Dec 24, 2018

@manucorporat here is the sample app in which we can reproduce this issue. Go to preference page.

https://github.com/stripathix/ionic-vue

  1. Initially it looks like this screenshot 2018-12-24 at 8 44 01 pm

  2. On orientation change it font size changes screenshot 2018-12-24 at 8 44 08 pm

  3. Again on orientation change font stays same as in (2) screenshot 2018-12-24 at 8 44 15 pm

*Note: This issue occurs only if you run app on device or simulator on browser this issue does not occur. So please run this in simulator iPhone 8. I am using capacitor for packaging.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ion-list font size not working right on orientation change for ...
Current behavior: I have 3 lists wrapped in swiper slides. On changing orientation from portrait to landscape font-size of ion-item in ion-list ......
Read more >
Preserve HTML font-size when iPhone orientation changes ...
Preserve HTML font-size when iPhone orientation changes from portrait to landscape - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing ......
Read more >
Unable to use Messages app in landscape - Apple Discussions
Hello,. I just got my iPhone 12 Mini. In the Messages app, landscape (horizontal) orientation does not work. In the message list, inside...
Read more >
List's items lose alignment when changing the screen rotation
I need really to show continuously the select UI at left, but the text can be truncated. The error is when I rotates...
Read more >
iPhone: font-size gets bigger on orientation chg - SitePoint
I want the font-size throughout not to change (can change when user chooses to zoom up, but I don't want any font-sizes to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found