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

QuickOpen Input: Fixes Validation which produces #42763 #45077

Closed

Conversation

raygervais
Copy link
Contributor

This fixes the issue which was described by #42763

Examples:

Code Used to Simulate Error

custom component validation fix

Azure Functions Replication of Error

azure custom fix

@kieferrm kieferrm requested a review from jrieken March 6, 2018 01:30
@jrieken jrieken added this to the March 2018 milestone Mar 6, 2018
@@ -329,7 +329,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
}

// Respect input value
if (options.value) {
if (options.value && !options.valueSelection) {
this.pickOpenWidget.setValue(options.value, options.valueSelection);
Copy link
Member

Choose a reason for hiding this comment

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

Aren't we loosing the value here as soon as a selection is provided? Isn't the better change to reset valueSelection after an validation pass?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue I found (just to clarify my thinking, not implying that it's correct) is that we set the value if it's present in options.value, which causes the cursor to move to the end of the string.

By checking that we haven't already started the validation process (init), we can set the value / placeholder / template value, and then when the user begins to enter their own (and thus we start validating against the rule set), and ignore setting the value itself which would cause the cursor jump. I'm unsure how the selection works in all it's entirety, so if you have a better solution / idea I'm open to fixing this PR and learning from the updated fix.

Copy link
Member

Choose a reason for hiding this comment

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

which causes the cursor to move to the end of the string.

I believe that happens because we explicitly set the value selection

@jrieken jrieken closed this Mar 12, 2018
@jrieken
Copy link
Member

jrieken commented Mar 12, 2018

Closing this because I have pushed a fix for the underlying issue... Sorry for jumping in but the quick-pick infrastructure is a minefield full of debt and surprises. I am not expecting anyone to find his/her way around in there. cc @bpasero

@bpasero
Copy link
Member

bpasero commented Mar 12, 2018

@jrieken yup, one idea forward would be to take out the input-related UI pieces from quick open into their own widget and decouple this from quick open altogether. I talked with @chrmarti about it who is in charge to explore this in the context of more input-related things like wizards and multi-select input.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants