-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Request on 0.10: Add a class to the first suggestion if autoselect is true #483
Comments
Great point. Seeing as how v0.10 is about overdue by 5 or so months (my bad), I'm going to put this in the v0.10.1 milestone. |
👍 Thank you! |
+1 It looks like this issue hasn't been assigned to a milestone. Any plans for this in the near-future? |
I'm actually leaning towards removing the autoselect functionality, so to answer @dsposito's question, there are no plans for this in the near-future. |
Personally I'd hate to see it removed because my business people love/require autoselect. |
Yeah, I'm torn on what I should do. On one hand, I think the current implementation is half-baked so I don't want to encourage people to use it. On the other hand, it's something a lot people seem to use, so there's clearly a need for the functionality. At the very least, I won't remove the current implementation until there's something to replace it with. |
There is defiantly a big need for this feature. |
Really missing this, if demand is of any importance here's my +1 cents. |
Change the getDatumForSuggestion function to this one below when using autocomplete to auto-select the first item. getDatumForSuggestion: function getDatumForSuggestion($el) {
var datum = null;
if ($el.length) {
if(!this._getCursor().length){
this._setCursor(this._getSuggestions().first(),true);
}
datum = {
raw: Dataset.extractDatum($el),
value: Dataset.extractValue($el),
datasetName: Dataset.extractDatasetName($el)
};
}
return datum;
}, |
Can someone post an example on how to implement the |
@PierBover just make sure you've enabled the |
Ah thanks @galenwilk I thought the function was some callback |
Hi, thank you for this great plugin :) I've tried out the
integration-0.10.0
branch and love the new APIs. I have one request onautoselect
(related to #332 ): would it be possible to:tt-autoselect
class to thett-suggest
element that will be autoselected, just like.tt-cursor
.tt-autoselect
is only applied when the user has not manually selected anything. In other words, if the user mouses over some other.tt-suggest
element, then.tt-autoselect
should be removed from the first element until the user selects nothing again.This way, even if
hint
isfalse
, I'll be able to use CSS to signal users which suggestion will be autoselected upon hitting enter.Since the first element will always be auto-selected, I thought of using
.tt-suggest:first-child
in my CSS, but this doesn't work when there are more than one sections.The text was updated successfully, but these errors were encountered: