Skip to content

enable autocomplete to accept dropdown options - #60

Merged
DanielRuf merged 1 commit into
materializecss:v1-devfrom
nicknickel:autocomplete-dropdown-opts
Jan 7, 2021
Merged

enable autocomplete to accept dropdown options#60
DanielRuf merged 1 commit into
materializecss:v1-devfrom
nicknickel:autocomplete-dropdown-opts

Conversation

@nicknickel

Copy link
Copy Markdown

Proposed changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@nicknickel
nicknickel requested a review from a team December 30, 2020 04:51

@DanielRuf DanielRuf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@Smankusors Smankusors left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine from me. 👍

On the other side, I just found on the "select" documentation, there's additional documentation on Properties section. But... The name and description IMO doesn't make sense... More like... it tries to use existing variable but for different purpose? 😕

<tr>
<td>dropdownOptions</td>
<td>Element</td>
<td>Dropdown UL element.</td>
</tr>

@nicknickel

Copy link
Copy Markdown
Author

@Smankusors - I didn't notice that it. I used the select component as a reference when making this change and did notice that "dropdownOptions" is used for different purposes and is only differentiated by location / scope. Below is where the options that are passed to the dropdown component are used. The dropdownOptions in the documentation you linked are a property of the select component itself, not it's options, if that makes sense.

let dropdownOptions = $.extend({}, this.options.dropdownOptions);

In any case, it probably would be good to rename one of those "dropdownOptions" on the select component to clear up confusion. Maybe something for a new release since that would probably be a breaking change?

@DanielRuf

Copy link
Copy Markdown

In any case, it probably would be good to rename one of those "dropdownOptions" on the select component to clear up confusion. Maybe something for a new release since that would probably be a breaking change?

👍

@doughballs

Copy link
Copy Markdown

@Smankusors - I didn't notice that it. I used the select component as a reference when making this change and did notice that "dropdownOptions" is used for different purposes and is only differentiated by location / scope. Below is where the options that are passed to the dropdown component are used. The dropdownOptions in the documentation you linked are a property of the select component itself, not it's options, if that makes sense.

let dropdownOptions = $.extend({}, this.options.dropdownOptions);

In any case, it probably would be good to rename one of those "dropdownOptions" on the select component to clear up confusion. Maybe something for a new release since that would probably be a breaking change?

This confused me for a long time but actually, they named it perfectly - dropdownOptions are in fact ‘the options of the dropdown’, as opposed to say, selectOptions, which might refer to setting the <option> programmatically.

This would be a good feature add, along with allowing extra data to be passed to autocomplete - two use cases I come up against fairly frequently in the Gitter channel.

@Smankusors

Copy link
Copy Markdown
Member

In any case, it probably would be good to rename one of those "dropdownOptions" on the select component to clear up confusion. Maybe something for a new release since that would probably be a breaking change?

that would be a documentation improvement, and IMO should be a separate PR for that.

This confused me for a long time but actually, they named it perfectly - dropdownOptions are in fact ‘the options of the dropdown’, as opposed to say, selectOptions, which might refer to setting the <option> programmatically.

This would be a good feature add, along with allowing extra data to be passed to autocomplete - two use cases I come up against fairly frequently in the Gitter channel.

hmm makes sense.


aside from that, is this PR okay to merge?

@nicknickel

Copy link
Copy Markdown
Author

Not sure who you are asking but, from my perspective, this PR is ok to be merged.

@DanielRuf

Copy link
Copy Markdown

Thanks for the reviews, I'll merge it now.

@DanielRuf
DanielRuf merged commit 7da0213 into materializecss:v1-dev Jan 7, 2021
@nicknickel
nicknickel deleted the autocomplete-dropdown-opts branch January 7, 2021 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants