openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Fixed Read More Button Display Logic to Avoid Unnecessary Display

Open CodeMaverick2 opened this issue 5 months ago • 8 comments

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

  1. Capture "Read More" Button Height:

    • The height of the "Read more" button is now captured during initialization to ensure accurate calculations.
  2. 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

Screenshots

Screenshot from 2024-07-25 18-43-42

CodeMaverick2 avatar Sep 11 '24 20:09 CodeMaverick2