-
Notifications
You must be signed in to change notification settings - Fork 71
[IMP] spreadsheet: add named ranges feature #7605
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
base: master
Are you sure you want to change the base?
Conversation
d5688ce to
36b71ca
Compare
| protected initialContent: string | undefined = ""; | ||
| private colorIndexByRange: { [xc: string]: number } = {}; | ||
| private autoComplete: Store<AutoCompleteStore> = new AutoCompleteStore(this.get); | ||
| private hasSelectedAProposal: boolean = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kinda sucks ... but I don't have a better idea.
The problem is if we open a composer on a formula like =MyNamedRange. The autocomplete dropdown is open, and MyNamedRange is selected. If we press enter, provider.selectProposal will be called, do nothing, the dropdown will be closed ... and the promptly re-opened since nothing changed, so pressing enter will do absolutely nothing and we cannot close the composer.
And we don't want to hide the dropdown if this._currentContent === this.initialContent otherwise we don't have functions auto-complete either ...
71acd88 to
ec5e66f
Compare
fa95e29 to
629d0a0
Compare
629d0a0 to
1c54b28
Compare
With this commit, we now give the full proposal object as argument of `selectProposal` method of auto-complete providers, instead of only the text value of the proposal. This will be useful for the named range autocomplete, as we need to differentiate between a function and named range proposal. Task: 5380498
The `props.onChange` of the `TextInput` was called three times when
pressing enter:
1) once in the `onKeyDown` when we called `this.save()`
2) once in the `save` when we called `this.inputRef.el?.blur()`, which
triggered the `onBlur` event listener
3) once again in the `save` when we called `this.inputRef.el?.blur()`,
because HTML input elements trigger the `onChange` event when
losing focus.
This is very problematic when `props.onChange` dispatches a command
for example.
The issue was fixed by adding a `lastOnChangeValue` property that
stores the last value sent to `props.onChange`, and preventing another
call if the value did not change[1].
Another problem was the `save` had a `keepFocus` that was never used,
except accidentally when we gave the event in place of this argument.
[1] A better fix would have been to blur the input on `Enter`, and rely
on the `onChange` event triggered by the HTML input element when losing
focus. But this behavior, even if it's in the HTML spec, isn't
implemented in JSDOM. So all of our test would stop working.
Task: 5380498
This commits adds the named ranges feature, that allows to defined a custom name for a range of cells, and use that name in formulas. Task: 5380498
1c54b28 to
a3edf96
Compare

Description:
This commits adds the named ranges feature, that allows to defined a
custom name for a range of cells, and use that name in formulas.
Task: 5380498
review checklist