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

[Feature] Reactive multi-select options through closure, plus auto-validation #116

Closed
wants to merge 2 commits into from
Closed

[Feature] Reactive multi-select options through closure, plus auto-validation #116

wants to merge 2 commits into from

Conversation

GoodM4ven
Copy link

@GoodM4ven GoodM4ven commented Feb 21, 2024

Changes:

  • Added the ability to provide multiselect options as a closure [reactivity]
    • Created an evaluater for the closer to be called wherever the options are needed
    • Added a test for the feature, then tested everything
  • Made the multi-select trigger upon selection (space key) [auto-validation]
    • Exposed validate method for that to happen

Concerns:

  • Should there be a config check for whether to do the validation instantly? Or why doesn't validation happens upon selection by default?
  • Honestly, I can't seem to understand how would I trigger the option re-evaluation without triggering validation first!

Issues:

  • Need to re-evaluate the index, or else movement wouldn't be normal.
  • Need to trigger show changes without triggering validation, because re-evaluation currently works only when everything is valid.

Todo:

  • Docs; with a good example for reactivity!

Use-case:
https://github.com/laravel/prompts/assets/121377476/bfce061c-30e3-4456-93c5-84d1ec68e77a

Comments:
Dude! How many places should they have the project-name shown at in VSCodium?!!! lol

…lidation

Changes:
- Added the ability to provide multiselect options as a closure
    - Created an evaluater for the closer to be called wherever the options are needed
    - Added a test for the feature, then tested everything
- Made the multi-select trigger upon selection (space key)
    - Exposed validate method for that to happen

Concerns:
- Should there be a config check for whether to do the validation instantly? Or why doesn't validation happens upon selection by default?
- Honestly, I can't seem to understand how would I trigger the option re-evaluation without triggering validation first!
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@GoodM4ven GoodM4ven marked this pull request as ready for review February 22, 2024 04:47
@GoodM4ven GoodM4ven marked this pull request as draft February 22, 2024 04:58
@driesvints
Copy link
Member

@GoodM4ven feel free to resend this once you're ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants