Skip to content

bug: IonLabel does not re-render dynamic content when placed after an IonList #26853

@crhayes

Description

@crhayes

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • v7.x
  • Nightly

Current Behavior

An IonLabel that appears below an IonList will not re-render dynamic values when the underlying value changes as a result of removing an item from the IonList.

Notes:

  • This behaviour does not occur when the IonLabel appears above the list
  • The value re-renders correctly when not placed inside an IonLabel
  • I can only reproduce this on native iOS (simulator and physical device) and Safari browser
  • I am experiencing this with Ionic React; I have not tried any other flavours of Ionic

Note that in the second image the sum is not correct.

image
image

Expected Behavior

The aforementioned IonLabel should correctly re-render dynamic values regardless of its placement relative to an IonList.

Steps to Reproduce

Setup

git clone git@github.com:crhayes/ionic-label-bug-repro.git
cd ionic-label-bug-repro
npm install
ionic build

# Test native iOS
ionic capacitor run ios

# Test Safari
ionic serve

Use the Repro

The repro contains a list of value items as well as a sum item. Clicking a value item will remove it and should update the sum.

  1. Use the checkboxes to test the various cases in the Test Cases table
  2. Click the interactive value items to remove them
  3. Note that in Safari and native iOS the Sum does not update when value is rendered inside a label and below the list
  4. Note the above case works in Chrome
  5. Note that all other cases work in all environments and browsers

Test Cases

Inside Label? Bottom? Bug?
Y Y Y
Y N N
N Y N
N N N

Code Reproduction URL

https://github.com/crhayes/ionic-label-bug-repro

Ionic Info

Ionic:

   Ionic CLI       : 6.20.8 (/Users/hayes/.nvm/versions/node/v16.14.2/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/react 6.5.6

Capacitor:

   Capacitor CLI      : 4.7.0
   @capacitor/android : not installed
   @capacitor/core    : 4.7.0
   @capacitor/ios     : 4.7.0

Utility:

   cordova-res : not installed globally
   native-run  : 1.7.1

System:

   NodeJS : v16.14.2 (/Users/hayes/.nvm/versions/node/v16.14.2/bin/node)
   npm    : 8.5.0
   OS     : macOS Unknown

Additional Information

My device details:

  • iOS 16.1
  • iPhone 14 simulator & iPhone 13 Pro Max simulator & iPhone 13 physical
  • Safari Version 16.1 (18614.2.9.1.12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions