0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/frontend
Joffrey JAFFEUX bc36f0355d
FIX: prevents scroll-lock to crash the app (#36246)
In rare cases, especially on mobile, we could end up in a situation
where `null` is given to `unlockScroll`, we were given a default arg to
the function through: `unlockScroll(element =
document.scrollingElement)` but this is working only if the given
element is `undefined` and not `null` resulting sometimes in the
following error:

```js
TypeError: null is not an object (evaluating 'element.classList')
```

Following this error, the whole UI would become unresponsive.

Here is a simple example to demonstrate the buggy behavior here:

```js
function greet(name = "World") {
  console.log(`Hello, ${name}!`);
}

greet(); // Hello, World! ✓ (default applied)
greet(undefined); // Hello, World! ✓ (default applied)
greet(null); // Hello, null!  ✗ (default NOT applied!)
```
2025-11-26 11:14:57 +01:00
..
asset-processor Build(deps-dev): Bump vitest from 4.0.12 to 4.0.13 (#36183) 2025-11-24 01:06:30 +01:00
custom-proxy Build(deps-dev): Bump glob from 11.0.3 to 11.1.0 (#36072) 2025-11-19 02:15:11 +01:00
deprecation-silencer
discourse FIX: prevents scroll-lock to crash the app (#36246) 2025-11-26 11:14:57 +01:00
discourse-i18n
discourse-markdown-it A11Y: add aria-label to automatically generated heading anchor links in posts (#36232) 2025-11-25 18:29:20 -05:00
discourse-plugins Build(deps): Bump the babel group with 3 updates (#35582) 2025-10-24 13:25:57 +02:00
discourse-types DEV: Overhaul typechecking configuration (#35794) 2025-11-12 12:54:34 +00:00
discourse-widget-hbs Build(deps): Bump ember-auto-import from 2.11.2 to 2.12.0 (#36199) 2025-11-24 22:49:16 +01:00
ember-cli-progress-ci
pretty-text Build(deps): Bump ember-auto-import from 2.11.2 to 2.12.0 (#36199) 2025-11-24 22:49:16 +01:00
.npmrc
polyfills.js