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

未关闭
#30,921 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
angular, css, typescript
领域
frontend

调研方向

使用链接的 ionic-action-sheet-bug 仓库重现该问题,对比 @ionic/angular 8.7.12 和 8.7.11。然后检查 pull request #30769 中引用的更改,并验证选中的 ActionSheet 按钮会接收 action-sheet-selected 并应用自定义的 --button-color-selected 样式。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
52.8k
派生
13.3k
平均合并
3 天 1 小时
30 天内合并 PR
78

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/ionic-framework 的其他 Issue

查看 ionic-team/ionic-framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。