ionic-team / ionic-team/ionic-framework

feat: select buttons should be more customizable

未关闭
#21,172 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
package: core type: feature request
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

# Feature Request

**Ionic version:**
[x] **5.0.0**

**Describe the Feature Request**

Currently the [select API](https://ionicframework.com/docs/api/select) offers a way to set the cancel text with the [cancelText property](https://ionicframework.com/docs/api/select#properties), but not a way to edit the cancel icon when action sheet is used as interface.

**Describe Preferred Solution**
Add a `cancelIcon` property that can be used for action-sheet and alert interfaces. (For action sheet especially, there no styling difference between the cancel option and the others)

**Describe Alternatives**
When adding action sheet custom properties with a "buttons" property with a role "cancel", this doesn't erase the default cancel button either.

Take buttons properties, and use the role to erase any default role that would be set by the select component.

Following attempt (cf. suggested alternative) doesn't work:
TS file:
```typescript
// .ts file
customActionSheetOptions: any = {
buttons: [{
text: 'Cancel',
icon: 'close',
role: 'cancel'
}]
};
```
HTML file:
```html
doesn't change the icon of the cancel button

贡献指南

打开贡献指南

调研方向

Start with the Select API and its interfaceOptions handling for the action-sheet and alert interfaces. Trace how cancelText and default cancel buttons are assembled, then verify that a cancelIcon property and a custom cancel-role button produce the requested icon and do not leave a duplicate default button.

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

评估

技术栈
typescript
领域
frontend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

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