GithubHelp home page GithubHelp logo

Comments (4)

Swaagie avatar Swaagie commented on May 20, 2024

From what I understand, this is also how it should be 'worked around'. With taborder you should be able to force it in. Is there any specific reason the href has to be empty?

from minimize.

gambrose avatar gambrose commented on May 20, 2024

The link was being used to open a nav menu. It needed to be empty to not cause page navigation, we are using client side routing so could not use #. In the end we changed the ux pattern to not use the empty href.

The reason I reported it as an issue is that browsers behave differently if href is missing or empty. Minimizers should make the html as small as possible while still retaining the same behaviour should then not?

You can set taborder but that is the way to madness and bad ux as things invariably get out of order. Better to use the natural flow of the html to define the tab order. It makes including dynamic content more manageable.

from minimize.

Swaagie avatar Swaagie commented on May 20, 2024

I see, I would consider this an extreme edge case. One could argue browsers implement ambiguous behavior. Judging from your example though, wouldn't event.preventDefault have prevented navigation?

The first intent is to maximize the minification. Where options relax this state, so in this case I think the option is more suitable. The option could even be accompanied by a plugin that does remove all empty attributes from other elements than a. Which would then exactly do what you want.

from minimize.

gambrose avatar gambrose commented on May 20, 2024

event.preventDefault would work but I had listeners further up the dom than needed the event to bubble up.

I knew it was an edge case, as I said I have worked around the issue. I'm happy to respect your decision not to fix this issue that you feel too obscure.

from minimize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.