-
-
Notifications
You must be signed in to change notification settings - Fork 337
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] trigger 'focusin', 'focusout'. #3144
base: develop
Are you sure you want to change the base?
[Search] trigger 'focusin', 'focusout'. #3144
Conversation
It allows websites to implement a solution for this: [Search] Bring active result into view fomantic#3143 fomantic#3143
This patch at least allows for a partial solution to [Search] Bring active result into view #3143 It allows websites to implement their own solution, according to their needs.
This feels a bit hackish and too specific. It can be discussed whether something more appropriate could be considered to be included within Fomantic. At the very least, triggering |
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.
While this change does not seem to hurt the code (check my comment if focusout is really needed if we add focusin at the same time),
i wonder if this is really needed. The user could already make use of the mutationobserver and check for the added ".active" class
@@ -329,8 +329,10 @@ | |||
; | |||
$result | |||
.removeClass(className.active) | |||
.trigger('focusout') |
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.
Do we really need this? The direct focusin trigger 3 lines below should automatically trigger the focusout on the previous focused element, isnt it?
Btw we should not implement automatic scrolling of the core page into the FUI Code. I believe this will mess up existing projects in unexpected scenarios |
Of course not. I said so myself. The code I shared within a comment is a hack that works well in a very specific scenario where I needed it. I shared it so that interested Fomantic users can adapt it to their needs. But it is too specific to be included in Fomantic itself. ... Now, if the community can come up with something more general and acceptable for Fomantic, I'd be happy to test it out... |
I will investigate and come back to you soon. |
I didn't know the existence of MutationObservers... |
Trigger 'focusin' and 'focusout' whenever a search result item becomes active.
It allows websites to implement a solution for this: