From 1c1e4faab953700e2147e3115013a56b542661ed Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Tue, 16 Jul 2024 08:18:11 +0200 Subject: [PATCH] Fix default `scrollBehavior` value in docs (#2729) * Update reference.md * Update htmx.js * Update reference.md --- src/htmx.js | 2 +- www/content/reference.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/htmx.js b/src/htmx.js index 834c67794..bdfc9eff9 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -206,7 +206,7 @@ var htmx = (function() { disableSelector: '[hx-disable], [data-hx-disable]', /** * @type {'auto' | 'instant' | 'smooth'} - * @default 'smooth' + * @default 'instant' */ scrollBehavior: 'instant', /** diff --git a/www/content/reference.md b/www/content/reference.md index 017a02e92..41dee2618 100644 --- a/www/content/reference.md +++ b/www/content/reference.md @@ -240,7 +240,7 @@ listed below: | `htmx.config.disableSelector` | defaults to `[hx-disable], [data-hx-disable]`, htmx will not process elements with this attribute on it or a parent | | `htmx.config.withCredentials` | defaults to `false`, allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates | | `htmx.config.timeout` | defaults to 0, the number of milliseconds a request can take before automatically being terminated | -| `htmx.config.scrollBehavior` | defaults to 'smooth', the behavior for a boosted link on page transitions. The allowed values are `auto` and `smooth`. Smooth will smoothscroll to the top of the page while auto will behave like a vanilla link. | +| `htmx.config.scrollBehavior` | defaults to 'instant', the behavior for a boosted link on page transitions. The allowed values are `auto`, `instant` and `smooth`. Instant will scroll instantly in a single jump, smooth will scroll smoothly, while auto will behave like a vanilla link. | | `htmx.config.defaultFocusScroll` | if the focused element should be scrolled into view, defaults to false and can be overridden using the [focus-scroll](@/attributes/hx-swap.md#focus-scroll) swap modifier. | | `htmx.config.getCacheBusterParam` | defaults to false, if set to true htmx will append the target element to the `GET` request in the format `org.htmx.cache-buster=targetElementId` | | `htmx.config.globalViewTransitions` | if set to `true`, htmx will use the [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) API when swapping in new content. |