Fixed "Click to expand..." link/button for quote blocks sometimes missing (race condition)

Steffen

Well-known member
Affected version
2.0.10
The "Click to expand..." link/button sometimes just doesn't appear and the quote block is cut-off midways. This is a race condition. I can reproduce the problem sometimes but not always, one of our users says that he can reliably reproduce the problem in the following example (both of us are using Chrome 70):
  1. Open https://www.computerbase.de/forum/t...beispiel-zu-ac-origins.1829356/#post-21817619
  2. Search for the spoiler button labeled "Spoiler: Kurzanleitung RAM OC" and click it (maybe use Ctrl+F)
  3. Scroll down until you see two quote blocks
Sometimes, the second quote block just doesn't have a "Click to expand..." link/button:

Screenshot from 2018-10-30 09-21-42.webp

In my tests, I can fix this issue with the following patch:

Diff:
--- a/js/xf/core.js
+++ b/js/xf/core.js
@@ -5791,7 +5791,7 @@ if (window.jQuery === undefined) jQuery = $ = {};

                         if (scroll == 0 || offset == 0)
                         {
-                            if (delay > 1000)
+                            if (delay > 2000)
                             {
                                 return;
                             }

It just increases the time span in which XenForo checks the scroll and offset height. It seems like this can be necessary for longer posts.

(A more robust solution could be to run the check until the "load" event fires, meanwhile exponentially increasing the check interval.)
 
Last edited:
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.2).

Change log:
Increase the BB code block sizing check window.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom