Code Monkey home page Code Monkey logo

Comments (10)

1cg avatar 1cg commented on May 18, 2024

Thank you for mentioning this! It turns out to my surprised that <a href>foo</a> is legal and does refer to the current page, so htmx should follow your suggested logic.

Are you interested in trying to implement it?

from htmx.

1cg avatar 1cg commented on May 18, 2024

fixed w/ 59444e8

from htmx.

mqudsi avatar mqudsi commented on May 18, 2024

Thank you very much. This really helps when composing behavior based on many separate htmx entities, each of which sets an individual URL parameter.

from htmx.

bencroker avatar bencroker commented on May 18, 2024

Am I correct in thinking that the following should trigger a GET request to the current page when the value is changed? I'm not seeing anything happening in 0.4.0.

<input hx-get type="text" name="email">

from htmx.

1cg avatar 1cg commented on May 18, 2024

I don't like that I didn't submit a test w/ 59444e8, so it might still be an open issue. @bencroker what behavior are you seeing?

I need to think about how to test this.

from htmx.

bencroker avatar bencroker commented on May 18, 2024

I'm seeing no reaction. It looks like the issue might be that the path is empty here:

htmx/src/htmx.js

Lines 825 to 829 in f8dfe72

function processVerbs(elt, nodeData, triggerSpecs) {
var explicitAction = false;
forEach(VERBS, function (verb) {
var path = getAttributeValue(elt, 'hx-' + verb);
if (path) {

from htmx.

1cg avatar 1cg commented on May 18, 2024

yep, that's it. need to check if the attribute exists rather than test its value.

you want to take a crack at it?

from htmx.

bencroker avatar bencroker commented on May 18, 2024

The PR above fixes the issue, thanks for the nudge!

from htmx.

1cg avatar 1cg commented on May 18, 2024

OK, the tests are a little janky but they work and verify the behavior to a reasonable extent:

d144742

this will go out w/ 0.0.5

from htmx.

bencroker avatar bencroker commented on May 18, 2024

Thanks, I'll be sure to write a test next time, now that I see how you did it.

from htmx.

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.