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

[Search] Enter key selects active result, but doesn't follow its href #3409

Closed
awgv opened this issue Nov 30, 2015 · 3 comments
Closed

[Search] Enter key selects active result, but doesn't follow its href #3409

awgv opened this issue Nov 30, 2015 · 3 comments
Milestone

Comments

@awgv
Copy link
Member

awgv commented Nov 30, 2015

Hello,

I decided to separate this issue, since the initial mentioning #3111 was closed. When you return search results with a url property, SUI pastes it inside a href attribute, and while you can click on a search result to follow it, or navigate using arrow keys, you can't follow a link by hitting Enter; it just pastes whatever it is inside a .title inside the search input.

Please see this JSFiddle for an example: type "an", choose a result with arrow keys and hit Enter.

@larsbo
Copy link
Contributor

larsbo commented Mar 10, 2016

There is a bug at https://github.com/Semantic-Org/Semantic-UI/blob/master/src/definitions/modules/search.js#L174
The $resultselector already points at the a tag therefore the $link (+ href & target) selectors are always empty.

@Neablis
Copy link

Neablis commented Apr 13, 2016

I am currently running into this bug. I changed the line @larsbo recommended to
$link= $result.find('a[href]').eq(0) === [] ? $result.find('a[href]').eq(0) : $result.eq(0),
Its not elegant but i didn't want to touch too much of there code and it works.

@jlukic jlukic added this to the 2.1.9 milestone Apr 13, 2016
@jlukic jlukic modified the milestones: 2.1.9, 2.2 May 4, 2016
@jlukic
Copy link
Member

jlukic commented May 15, 2016

Added solve

@jlukic jlukic closed this as completed May 15, 2016
jlukic added a commit that referenced this issue May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants