Card Layout scroll Control.

Certified Associate Developer

Hello All,

My requirement is that in a chat we need to show the conversation. This conversations is shown in a card layout with height as MEDIUM. When there are too many conversations, card layout is showing the scroll. Below conversation card layout, we have a text box and a send button. Once user clicks the send button then the user text is appended in the conversation card layout which makes the layout to re-evaluate itself and the first conversation is shown. To see the latest, we need to scroll below.

Is there any way to fixed the position of scroll bar if the text is appended in the card layout?

Regards

Arka

  Discussion posts and replies are publicly visible

Parents
  • Yes, you can achieve the behavior you described by utilizing JavaScript to manipulate the scroll position of the conversation card layout after appending new text.

    Append Text to Conversation: When the user clicks the send button, append the user's text to the conversation card layout.

    Adjust Scroll Position: After appending the text, use JavaScript to adjust the scroll position of the conversation card layout to ensure that the latest conversation remains visible without the need for manual scrolling.

    Scroll Adjustment Function: Write a function that scrolls the conversation card layout to the bottom whenever new text is appended. You can use methods like scrollTop or scrollIntoView to achieve this.

    Call the Function After Appending Text: Call the scroll adjustment function immediately after appending the user's text to the conversation card layout. 

    scratch geometry dash

Reply
  • Yes, you can achieve the behavior you described by utilizing JavaScript to manipulate the scroll position of the conversation card layout after appending new text.

    Append Text to Conversation: When the user clicks the send button, append the user's text to the conversation card layout.

    Adjust Scroll Position: After appending the text, use JavaScript to adjust the scroll position of the conversation card layout to ensure that the latest conversation remains visible without the need for manual scrolling.

    Scroll Adjustment Function: Write a function that scrolls the conversation card layout to the bottom whenever new text is appended. You can use methods like scrollTop or scrollIntoView to achieve this.

    Call the Function After Appending Text: Call the scroll adjustment function immediately after appending the user's text to the conversation card layout. 

    scratch geometry dash

Children