File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 ))
You can’t perform that action at this time.
0 commit comments