Skip to content

Commit

Permalink
Fix JS position in sprig.triggerRefreshOnLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Aug 29, 2024
1 parent 9595d92 commit 513f544
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Notes for Sprig Core

## 2.12.0 - Unreleased
## 2.12.0 - 2024-08-29

### Added

Expand All @@ -10,6 +10,10 @@

- Updated htmx to version 2.0.2 ([changelog](https://github.com/bigskysoftware/htmx/blob/master/CHANGELOG.md#202---2024-08-12)).

### Fixed

- Fixed the positioning of the JavaScript output by the `sprig.triggerRefreshOnLoad` function.

### Deprecated

- Deprecated `sprig.getIsBoosted`, `sprig.getIsError`, `sprig.getIsHistoryRestoreRequest`, `sprig.getIsInclude`, `sprig.getIsRequest`, `sprig.getIsSuccess`. Use `sprig.isBoosted`, `sprig.isError`, `sprig.isHistoryRestoreRequest`, `sprig.isInclude`, `sprig.isRequest`, `sprig.isSuccess` instead.
Expand Down
2 changes: 1 addition & 1 deletion src/base/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public static function triggerRefreshOnLoad(string $selector = ''): void
});
JS;

Craft::$app->getView()->registerJs($js);
Craft::$app->getView()->registerJs($js, View::POS_END);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/services/ComponentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private function getParseableTags(string $content): array
Craft::error('Backtrack limit was exhausted!', __METHOD__);
}

return $matches[0] ?? [];
return [];
}

/**
Expand Down

0 comments on commit 513f544

Please sign in to comment.