File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1886,6 +1886,10 @@ var htmx = (function() {
18861886 if ( ! swapOptions ) {
18871887 swapOptions = { }
18881888 }
1889+
1890+ target = resolveTarget ( target )
1891+ target . classList . add ( htmx . config . swappingClass )
1892+
18891893 // optional transition API promise callbacks
18901894 let settleResolve = null
18911895 let settleReject = null
@@ -1895,7 +1899,6 @@ var htmx = (function() {
18951899 let doSwap = function ( ) {
18961900 maybeCall ( swapOptions . beforeSwapCallback )
18971901
1898- target = resolveTarget ( target )
18991902 const rootNode = swapOptions . contextElement ? getRootNode ( swapOptions . contextElement , false ) : getDocument ( )
19001903
19011904 // preserve focus and selection
@@ -4933,8 +4936,6 @@ var htmx = (function() {
49334936 swapSpec . ignoreTitle = ignoreTitle
49344937 }
49354938
4936- target . classList . add ( htmx . config . swappingClass )
4937-
49384939 if ( responseInfoSelect ) {
49394940 selectOverride = responseInfoSelect
49404941 }
Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ describe('hx-swap-oob attribute', function() {
435435 make ( '<table id="table"><tbody></tbody></table>' )
436436 div . click ( )
437437 this . server . respond ( )
438- byId ( 'table' ) . innerHTML . should . equal ( '<tbody><tr><td>Swapped15</td></tr></tbody>' )
438+ byId ( 'table' ) . innerHTML . should . equal ( '<tbody class="" ><tr><td>Swapped15</td></tr></tbody>' )
439439 } )
440440
441441 it ( 'works with a swap delay' , function ( done ) {
You can’t perform that action at this time.
0 commit comments