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

enable autocomplete to accept dropdown options #60

Merged
merged 1 commit into from
Jan 7, 2021
Merged

enable autocomplete to accept dropdown options #60

merged 1 commit into from
Jan 7, 2021

Conversation

nicknickel
Copy link

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
Copy link

@DanielRuf DanielRuf left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Smankusors Smankusors left a comment

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
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

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

@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
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
Author

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

@DanielRuf
Copy link

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