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

[Maps] Autocomplete for custom color palettes and custom icon palettes #56446

Merged
merged 17 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const ColorStopsCategorical = ({

return (
<StopInput
key={field.getName()} // force new component instance when field changes
Copy link
Contributor

Choose a reason for hiding this comment

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

this is really clever

field={field}
getValueSuggestions={getValueSuggestions}
value={stopValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ export class StopInput extends Component {

componentDidMount() {
this._isMounted = true;
this._prevFieldName = undefined;
this._loadFieldDataType();
}

componentDidUpdate() {
this._loadFieldDataType();
}

Expand All @@ -37,11 +32,6 @@ export class StopInput extends Component {
}

async _loadFieldDataType() {
if (this.props.field.getName() === this._prevFieldName) {
return;
}

this._prevFieldName = this.props.field.getName();
const fieldDataType = await this.props.field.getDataType();
if (this._isMounted) {
this.setState({ fieldDataType });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export function IconStops({
/>
) : (
<StopInput
key={field.getName()} // force new component instance when field changes
field={field}
getValueSuggestions={getValueSuggestions}
value={stop}
Expand Down