Skip to content

Commit 68c29e7

Browse files
committed
Merge four-dev into this branch
2 parents a00815a + 60ace48 commit 68c29e7

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

‎src/htmx.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,9 +957,7 @@ var htmx = (() => {
957957
htmxProp.initialized = true;
958958
htmxProp.eventHandler = this.__createHtmxEventHandler(elt);
959959
htmxProp.boosted = hxBoost;
960-
let eventName = elt.matches('a') ? 'click' : 'submit';
961-
elt._htmx.listeners.push({fromElt: elt, eventName, handler: elt._htmx.eventHandler});
962-
elt.addEventListener(eventName, elt._htmx.eventHandler);
960+
this.__initializeTriggers(elt);
963961
this.__trigger(elt, "htmx:after:init", {}, true)
964962
}
965963
}

‎test/tests/attributes/hx-boost.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ describe('hx-boost attribute', async function() {
153153
}
154154
})
155155

156+
it('boosted link should be triggered by custom event', async function() {
157+
mockResponse('GET', '/test', 'Boosted')
158+
createProcessedHTML('<div id="result"></div><a hx-boost="true" hx-trigger="foo" hx-target="#result" id="a1" href="/test">Click Me</a>')
159+
htmx.trigger(find('#a1'), 'foo')
160+
await forRequest()
161+
find('#result').innerHTML.should.equal('Boosted')
162+
})
163+
164+
it('boosted form should be triggered by custom event', async function () {
165+
mockResponse('POST', '/test', 'Boosted')
166+
createProcessedHTML('<div id="result"></div><form hx-boost="true" hx-trigger="foo" hx-target="#result" id="f1" action="/test" method="post"></form>')
167+
htmx.trigger(find('#f1'), 'foo')
168+
await forRequest()
169+
find('#result').innerHTML.should.equal('Boosted')
170+
})
171+
156172
// // it('overriding default swap style does not effect boosting', async function() {
157173
// // htmx.config.defaultSwapStyle = 'afterend'
158174
// // try {

‎www/src/assets/css/site.css‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ article.sticky-headers > section :is(h3, h4) {
318318
article.sticky-headers > section > h2 > :first-child {
319319
background: transparent;
320320
border-bottom-color: transparent;
321-
animation: stick-bg linear both;
321+
animation-name: stick-bg;
322+
animation-timing-function: linear;
323+
animation-fill-mode: both;
322324
animation-timeline: --section;
323325
animation-range:
324326
cover calc(100vh - var(--header-offset))

0 commit comments

Comments
 (0)