bug: ActionSheet CSS custom properties are applied to 'selected' role button since 8.7.12

Offen
#30,921 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, css, typescript
Bereich
frontend

Rechercherichtung

Reproduziere das Problem mit dem verlinkten Repository ionic-action-sheet-bug und vergleiche @ionic/angular 8.7.12 mit 8.7.11. Untersuche anschließend die in Pull Request #30769 referenzierte Änderung und verifiziere, dass der ausgewählte ActionSheet-Button action-sheet-selected erhält und den benutzerdefinierten --button-color-selected-Stil anwendet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

package: core type: bug
Prerequisites
Ionic Framework Version

v8.x

Current Behavior

When we set the role: 'selected' property on an ActionSheetButton the rendered html button is missing class action-sheet-selected. This results in missing applied css styles applied, e.g. if we set --button-color-selected on for the action sheet's custom css class, that style is not shown.

Example ActionSheetButton

    {
      text: 'Share',
      role: 'selected',
      data: {
        action: 'share',
      },
    },

Other action-sheet-ROLE classes (e.g. destructive are still applied to the button.

Expected Behavior

The css class action-sheet-selected is applied if a button's role is set to selected and therefore the custom css properties are taking action.

For instance if I set --button-color-selected: purple; (with a proper css class attached to my action sheet) I expect that the button with role selected is showing a purple text color.

Steps to Reproduce
  1. go to https://github.com/pjaecks-carecompass/ionic-action-sheet-bug
  2. clone repository
  3. npm ci - this will install @ionic/[email protected]
  4. npm start, open http://localhost:4200
  5. tap the "Open" button to show the ActionSheet
  6. check for the text color of the "Share" button - it is the default text color
  7. now install previous ionic angular version with npm install --save --save-exact @ionic/[email protected]
  8. repeat step 4 and 5
  9. check the text color of the "Share" button - this is now purple because the styling defined in app.component.scss is applied
Code Reproduction URL

https://github.com/pjaecks-carecompass/ionic-action-sheet-bug

Ionic Info
Ionic:

   Ionic CLI                     : 5.4.16 (/home/USER/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic)
   Ionic Framework               : not installed
   @angular-devkit/build-angular : 20.3.14
   @angular-devkit/schematics    : 20.3.14
   @angular/cli                  : 20.3.14
   @ionic/angular-toolkit        : 12.3.0

Utility:

   cordova-res                          : not installed
   native-run (update available: 2.0.3) : 2.0.1

System:

   NodeJS : v22.21.0 (/home/USER/.nvm/versions/node/v22.21.0/bin/node)
   npm    : 10.9.4
   OS     : Linux 6.6
Additional Information

I suspect https://github.com/ionic-team/ionic-framework/pull/30769 to introduce this.

This change (bug?) was introduced in 8.7.12.

With 8.7.11 it is still working fine.

Vorherrschende Sprache
TypeScript
Sterne
52.8k
Forks
13.3k
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
78

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ionic-team/ionic-framework

Alle Issues in ionic-team/ionic-framework

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.