Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: AlertButton types do not autocomplete with available options #27965

Closed
3 tasks done
izyuumi opened this issue Aug 10, 2023 · 4 comments · Fixed by #27940
Closed
3 tasks done

bug: AlertButton types do not autocomplete with available options #27965

izyuumi opened this issue Aug 10, 2023 · 4 comments · Fixed by #27940
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@izyuumi
Copy link
Contributor

izyuumi commented Aug 10, 2023

Prerequisites

Describe the Feature Request

Support for autocomplete for the two types defined cancel and destructive, and also supports any arbitrary string if passed in.

Describe the Use Case

Whenever using the AlertButton, autocomplete will help with correctness, such as not making mistakes with spelling.

Describe Preferred Solution

Solution listed in #27940

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

@NextThread
Copy link

hey, can I work on this?

@sean-perkins
Copy link
Contributor

Hello @aapl-yumi thanks for creating this ticket! I think we should track this as a bug with the existing implementation. I'll update the title accordingly.

We had a similar issue with Ionic colors with the color attribute in the past and it is a limitation of doing a union type with a string. We ended up using a Record<never, never> union to resolve it for that problem - likely should do a similar thing here.

I'll reply to your PR with more feedback shortly, but we should address this 👍

@NextThread I appreciate your interest in contributing! Since the work is already in progress, I don't think this ticket would be a good one for you to pick up. If there are any other tickets that you are interested in or if you are generally interested in contributing to open source in general - you can message me in the Ionic discord and I'd be happy to help get you started!

@sean-perkins sean-perkins changed the title feat: Add loose autocomplete for AlertButton interface bug: AlertButton types do not autocomplete with available options Aug 17, 2023
@sean-perkins sean-perkins added package: core @ionic/core package type: bug a confirmed bug report labels Aug 18, 2023
@ionitron-bot ionitron-bot bot removed the triage label Aug 18, 2023
github-merge-queue bot pushed a commit that referenced this issue Jan 30, 2024
…able options (#27940)

Issue number: resolves #27965

---------


https://www.youtube.com/watch?v=a_m7jxrTlaw&list=PLIvujZeVDLMx040-j1W4WFs1BxuTGdI_b&index=3


<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
There is a lack of autocomplete support for AlertButton attribute of
`role` (there may be similar situations for other components too,
however, I was working on this component and found it).

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Support for autocomplete for the two types defined `cancel` and
`destructive`, and also supports any arbitrary string if passed in.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information
<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
I suggest there to be some global interface similar to the following:
```
interface LooseAutocomplete<T extends string> = T | Omit<string, T>;
```
I referenced this great [video](https://youtu.be/a_m7jxrTlaw) from Matt
@mattpocock

---------

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #27940, and a fix will be available in an upcoming release of Ionic Framework.

Copy link

ionitron-bot bot commented Feb 29, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
4 participants