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

Cascader: Don't lose input value when typing #84274

Merged
merged 1 commit into from Mar 12, 2024

Conversation

JoaoSilvaGrafana
Copy link
Contributor

@JoaoSilvaGrafana JoaoSilvaGrafana commented Mar 12, 2024

What is this feature?

Currently when you type on the Cascader input after something has been selected, it deletes your selection. For instance if you use "suffix:unit1" and want to change it to "suffix:unit2" you have to retype it all instead of it allowing you to make a simple change from "1" to "2".

Comment explaining what is happening on the original issue:

What happens is that when you open the Cascader, it renders the rc-cascader component, but as you start typing something it switches it to a regular Select and just loses what was on the input.

I've tried to fix this quickly by having the Select input being controlled, but that makes some parts of this interaction not ideal, for instance selecting the whole input and then typing doesn't replace the whole content, just adds what you typed to the end, so I'd like to get some input on if this is a good solution or not before moving ahead with the fix

Why do we need this feature?

To make it simpler to type a different value on the Cascader.

Who is this feature for?

Anyone who use cascader.

Which issue(s) does this PR fix?:

Fixes #82896

Special notes for your reviewer:
I will like for someone to have a double check at this to see if this makes sense at all or if introducing this causes more issues than it solves things.

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@JoaoSilvaGrafana JoaoSilvaGrafana added area/grafana/ui Issues that belong to components in the @grafana/ui library no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Mar 12, 2024
@JoaoSilvaGrafana JoaoSilvaGrafana requested a review from a team as a code owner March 12, 2024 12:28
@JoaoSilvaGrafana JoaoSilvaGrafana requested review from Clarity-89 and ashharrison90 and removed request for a team March 12, 2024 12:28
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.0.x milestone Mar 12, 2024
@JoaoSilvaGrafana
Copy link
Contributor Author

/deploy-to-hg

@ephemeral-instances-bot

This comment was marked as outdated.

@ephemeral-instances-bot

This comment was marked as outdated.

@JoaoSilvaGrafana
Copy link
Contributor Author

/deploy-to-hg

@ephemeral-instances-bot
Copy link

  • Preparing your instance. A comment containing your instance's url will be added to this PR when the instance is ready.
  • Your instance will be ready in ~10 minutes.
  • Check the GitHub actions tab to follow the workflow progress
  • Slack channel: #proj-ephemeral-hg-instances
  • Building instance with joao_silva/cascader_typing oss branch and main enterprise branch. How to choose a branch

@ephemeral-instances-bot
Copy link

Copy link
Contributor

@Clarity-89 Clarity-89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix makes sense to me, great work 🚀

@JoaoSilvaGrafana JoaoSilvaGrafana modified the milestone: 11.0.x Mar 12, 2024
@JoaoSilvaGrafana JoaoSilvaGrafana merged commit 6080a9c into main Mar 12, 2024
31 checks passed
@JoaoSilvaGrafana JoaoSilvaGrafana deleted the joao_silva/cascader_typing branch March 12, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend area/grafana/ui Issues that belong to components in the @grafana/ui library no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing custom units is impossible because the combo box is cleared when typing
3 participants