Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Remirror

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: How to make this work with no links at the top level? #8294
    Remirror
    Participant

    Upon closer look, I experience some trouble with your solution regarding problem 3 (as exemplified by the ui-autocomplete element):

    • After having selected a city, try selecting another city. This does not work for me because the ui-autocomplete does not close the second time.
    • More generally, stopping event propagation may not be the best idea. What if other plugins define event handlers for the stopped events?
    • Your solution works for ui-autocomplete, and it is easy to extend to other elements/widgets if they are known in advance. But what if I want to create a SM-based component that can be used with <i>any</i> widget in it?

    Thank you for your help.

    in reply to: How to make this work with no links at the top level? #8289
    Remirror
    Participant

    Thank you! This indeed is pretty. I think this will work for most issues.
    Maybe you could include the mega-menu class in your docs, I can’t find anything about it there.

    in reply to: How to make this work with no links at the top level? #8287
    Remirror
    Participant

    Well, this is not so simple because I use SmartMenus in combination with a lot of other stuff such as custom tags. However, here is a toy example which demonstrates three problems: https://jsfiddle.net/zLnqcb6y/.

    I managed to solve all of these problems, but I need to do a lot of hacking (including code changes) for this purpose.
    I think what would really be needed here were hooks in the code. For instance, problem 3 could be solved easily if you would provide a hook for the docClick function.

    Remirror
    Participant

    True, it does work this way, but it also has some drawbacks:

    • “a” is semantically wrong for non-link elements (e.g., separators or static textual Information)
    • “a” is not valid if it contains interactive content (e.g., buttons)
    • Even if I ignore the latter points, I cannot really use a (real, i.e. link) “a” within a dummy “a”

    For now, I will go with the (dynamic) code change solution, but it would be really nice to have this improved in the next release. It should only require small changes. And I’m convinced there will be a simple solution for the focus issue you describe (perhaps auto-adding “tabindex” to each element?).

    Remirror
    Participant

    I have the same issue, but I even want to use no-link items at arbitrary levels of the menu. Additionally, I want to be able to use block elements.

    The solution is actually very easy; just replace all “a”s in the SmartMenus code by, e.g., “.a” (i.e., use class names instead of tag names).

    However, this requires changes in the SmartMenus code. Instead of forking it and including your fork, you perhaps can use PHP to retrieve and preprocess the script accordingly.

Viewing 5 posts - 1 through 5 (of 5 total)