The issue
I've found a bug (it is in 1.7, 1.6 or maybe earlier). The affix and scrolled classnames on the AppElement wil be added to soon when there is a custom header above the #App.
The issue is in, Application.tsx on line 336.
const scrollListener = new ScrollListener((top: number) => {
const offset = appEl.getBoundingClientRect().top + document.body.scrollTop;
appEl.classList.toggle('affix', top >= offset);
appEl.classList.toggle('scrolled', top > offset);
appHeaderEl.classList.toggle('navbar-fixed-top', top >= offset);
});
On this line; const offset = appEl.getBoundingClientRect().top + document.body.scrollTop;
After scrolling, the offset will be smaller and the top wil be higher. On the half of the size of the header, the classnames will be added.
I think the solution is on line 337. Add the current top to the offset calculation; appEl.getBoundingClientRect().top + document.body.scrollTop + top
Flarum information
Flarum core 1.6.3
PHP version: 8.1.16
MySQL version: 8.0.28
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, bz2, posix, readline, Reflection, session, SimpleXML, pdo_sqlite, standard, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apcu, amqp, bcmath, Phar, calendar, exif, gd, gettext, gmp, imagick, imap, intl, ldap, mysqli, pcntl, pdo_mysql, pdo_pgsql, pgsql, shmop, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, xsl, zip, memcached, mongodb, redis, tideways, vips, xmlrpc, ionCube Loader, Zend OPcache
+---------------------------------------+------------+--------+
| Flarum Extensions | | |
+---------------------------------------+------------+--------+
| ID | Version | Commit |
+---------------------------------------+------------+--------+
| flarum-flags | v1.6.1 | |
| flarum-approval | v1.6.1 | |
| v17development-third-party-login-only | v0.1.1 | |
| tde-forum | dev-master | |
| tde-cache | dev-master | |
| tde-authentication | dev-master | |
| fof-oauth | 1.3.0 | |
| flarum-tags | v1.6.1 | |
| flarum-suspend | v1.6.1 | |
| flarum-subscriptions | v1.6.3 | |
| flarum-sticky | v1.6.1 | |
| flarum-statistics | v1.6.1 | |
| flarum-nicknames | v1.6.1 | |
| flarum-mentions | v1.6.3 | |
| flarum-markdown | v1.6.1 | |
| flarum-lock | v1.6.1 | |
| flarum-likes | v1.6.1 | |
| flarum-lang-english | v1.6.0 | |
| flarum-emoji | v1.6.1 | |
| flarum-bbcode | v1.6.0 | |
+---------------------------------------+------------+--------+