How to Anchor Chat Element to Just Above Nav Menu

I have elements above my chat collection that I can’t remove, but they remove themselves after the two users form a chat pair. That is to say that, for the user, the UI looks clean, but for Glide, there’s more than one element on the screen, so the chat input in the chat collection doesn’t anchor to the bottom of the screen.

Is there no way to mimic it with CSS? This got me pretty close.

.message-box [class*=“chat-input___StyledForm”] {
position: sticky;
bottom: 110px;

}

.message-box [data-testid=“empty-comments”], .message-box [class*=“comment-group___StyledDiv-”]{
min-height: 720px;
}

Can you include some images of what you want to achieve?

I think they wanted to add other components other than the Chat component on a Chat screen (like a bar at the top showing who you’re chatting to) without losing the feature which makes the chat sticky if it’s the only component (Not sure how to explain well :sweat_smile:)

In this image the chat component has a text field above that indicates what user the person is chatting with making it so the chat input bar floats in the middle of the screen.

As more text is entered, the chat input bar slides down the middle of the screen. I would really rather it stick to the top of the navigation menu.

Like so.

But it only sticks like that if it’s the ONLY element on the screen. It would be nice if there was a nav-menu stick option, but failing that I would like some ideas on what CSS to put here to get it to stick roughly around the

Instead of a text label you can just make the “Chat with _” text as the title of the chat component to get the same text label up the top but it remains sticky. I do wish someone still made a solution though incase we wanted other components at the top :sweat_smile:

Unfortunately that’s not an option. I use a chat request feature, so before a chat element is displayed, a popup of the user wishing to initiate a chat appears. If accepted, the chat element is revealed and the other elements disappear, and so all of those elements, even though they’re invisible, still disrupt the sticky behavior of the chat input bar. :frowning:

Oh yeah. Give us a solution then someoneeeeee!!

1 Like

I would rather use CSS to remove the native comment option, and then have a container with a text entry + submit button and stick it up top.

The chat element sticks to the bottom of the screen for me. Is it working like that for you?

If you add other elements onto the screen (even if they aren’t visible), then the chat input bar floats around the screen. It doesn’t stick to the bottom anymore. You should be able to see this by adding a piece of text above the chat collection.

Is it only on the mobile version that this happens?

Floats on tablet mode too.