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

Make Highlight Class Configurable. #188

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vivekitis
Copy link

@vivekitis vivekitis commented May 16, 2020

What: Added prop to set custom class for highlighted item. if prop is set then it will override default highlighted class.

Why: Wanted it as a feature. Ability to set custom class as highlighted class. could have used "componentAttrPrefix" but there are cases, like in module based vue styles were class names have random suffix. and cannot be predetermined, but need to be passed dynamically. Will not break existing functionality.

How: Added new prop 'component-attr-class-autosuggest-item-highlight'. During section rendering, this prop is transformed to highlightClass and passed to sectionConfig, since highlight class logic was hardcoded in section. Did not use section config to pass this prop because even though internally it is being passed through section config for design reasons, but for the user it is a global config. Please ignore formatting changes.. there are only 2 logical changes. one is function 'computedSections' in Autocomplete.vue and one is render function in the file DefaultSection.js.

Checklist:

  • [ x] Documentation
  • Tests
  • Ready to be merged
  • [ x] Added myself to contributors table

I had some issue regarding the code in function 'setCurrentIndex'. I've added comments. please inform if i'm mistaken. Failing test case was working through storybook but failing in test case, so i'm a bit confused as to why.

@vivekitis
Copy link
Author

Added Test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant