openlibrary
openlibrary copied to clipboard
Fixed Read More Button Display Logic to Avoid Unnecessary Display
Closes #9329
Description
This PR addresses an issue where the "Read more" button was displayed even when it made the section longer than the fully expanded content. This led to a confusing user experience, as the "Read more" button was not serving its intended purpose. The following changes have been made to resolve this issue:
Changes
-
Capture "Read More" Button Height:
- The height of the "Read more" button is now captured during initialization to ensure accurate calculations.
-
Update Condition in
reset
Method:- The logic that determines whether the "Read more" button should be displayed has been updated to include the height of the button. This ensures the button is only shown when it makes sense.
Impact
- Improved User Experience: The "Read more" button is now only displayed when necessary, preventing unnecessary clutter and confusion.
- Correct Layout Behavior: Ensures the layout behaves as expected, with the "Read more" button enhancing usability rather than detracting from it.
Testing
To test visit a link like https://testing.openlibrary.org/books/OL8978501M/Robin_Hood