-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: #7330, AutoComplete: Selected item is not getting highlighted when visited again unlike Dropdown component #7331
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,8 @@ const classes = { | |
listWrapper: 'p-autocomplete-items-wrapper', | ||
list: ({ virtualScrollerOptions, options }) => (virtualScrollerOptions ? classNames('p-autocomplete-items', options.className) : 'p-autocomplete-items'), | ||
emptyMessage: 'p-autocomplete-item', | ||
item: ({ suggestion, optionGroupLabel }) => (optionGroupLabel ? classNames('p-autocomplete-item', { 'p-disabled': suggestion.disabled }) : classNames('p-autocomplete-item', { 'p-disabled': suggestion.disabled })), | ||
item: ({ suggestion, optionGroupLabel, selected }) => | ||
optionGroupLabel ? classNames('p-autocomplete-item', { 'p-disabled': suggestion.disabled }, { selected: selected }) : classNames('p-autocomplete-item', { 'p-disabled': suggestion.disabled }, { selected: selected }), | ||
itemGroup: 'p-autocomplete-item-group', | ||
footer: 'p-autocomplete-footer', | ||
transition: 'p-connected-overlay' | ||
|
@@ -84,6 +85,10 @@ const styles = ` | |
padding: 0; | ||
list-style-type: none; | ||
} | ||
|
||
.selected { | ||
background-color: rgba(6, 182, 212, 0.24) !important; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the style added for p-highlight as a default style was already applied for autocomplete p-highlight class, and its working as expected. |
||
} | ||
|
||
.p-autocomplete-item { | ||
cursor: pointer; | ||
|
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.
Selected is weird should it be
p-selected
or is this what the other component does?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.
I can change it.
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.
Changed to p-highlight similar to dropdown component.