-
Notifications
You must be signed in to change notification settings - Fork 610
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
Feature/handle array of objects #16795
Closed
TxHawks
wants to merge
13
commits into
LeaVerou:gh-pages
from
TxHawks:feature/handle-array-of-objects
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2f355e5
Pass selected item's data to the select* events
TxHawks bf3adb9
Add an array-of objects-list example to the docs
TxHawks e93190d
Bring branch up to date with upstream
TxHawks d94167a
Align with changes introduced in #16794;
TxHawks 0ea78d7
Oops... forgot to add changes to the minified file
TxHawks 2951df6
Add missing `,`
TxHawks e5ba0c0
Fix Array of objects example in `index.html`
TxHawks 52dac84
Remove unused `dataset` property from `awesomplete-select` event
TxHawks dc966c9
Fix tests to add an event to select()
TxHawks d7f99fc
Make passing an event to `select()` optional
TxHawks da167eb
Revert "Fix tests to add an event to select()"
TxHawks b2532c1
Bring up to date with upstream
TxHawks 6342f43
Use `selected` instead of originalEvent.originalTarget
TxHawks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Might be a good idea to do something visual here, instead of doing
console.log
. One obvious example would be to use only URL property of item as input value when selected.Unfortunately, having selected element passed into
awesomplete-selectcomplete
here ine.originalTarget
allows only a hacky way to use different value for input when selected.We can change input value:
But this will happen after an input value was already changed to
selected.textContent
by awesomplete itself.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 also think that changing the input value in the event isn't good practice, as it can be easily done in the
item
function to begin with.I do agree that
console.log()
doesn't exactly showcase this ability very well though. I'll try and think of something better.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.
Strike what I said in the previous comment, it's absolutly rubbish.
Note to self: do not write when sleep deprived.
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 understood you actually meant
replace
function, where the input value is assigned from selected text now. Havingitem
instead oftext
inreplace
would make it possible to assign either item's key or value or some combination of them toinput.value
.