Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: A horizontal scroll bar appears with long white space before the text #2541

Closed
vihan85 opened this issue Oct 21, 2024 · 15 comments
Closed
Labels
bug Something isn't working status: unconfirmed

Comments

@vihan85
Copy link

vihan85 commented Oct 21, 2024

Describe the bug

A horizontal scroll bar appears with long white space before the text

To Reproduce

Steps to reproduce the behavior:

  1. Go to: input

  2. type:

                                                                                                                                            text
    

Expected behavior

Trim white space

Screenshots

image

If applicable, add screenshots to help explain your problem.

Package version

  • stream-chat-react: v12.2.2
  • stream-chat-css:
  • stream-chat-js: v8.40.9
@vihan85 vihan85 added bug Something isn't working status: unconfirmed labels Oct 21, 2024
@MartinCupela
Copy link
Contributor

hey @vihan85 , thank you for the report. Is this an issue for the UI of demo application?

@minhth1529
Copy link

Hi @MartinCupela, this issue occur on demo, I founded it on v11.23.6

@vihan85
Copy link
Author

vihan85 commented Oct 23, 2024

hey @vihan85 , thank you for the report. Is this an issue for the UI of demo application?
@MartinCupela
yes, I found it on your demo.

@minhth1529
Copy link

Hi @MartinCupela this issue confirmed?

@MartinCupela
Copy link
Contributor

So the issue description confused me, as I was typing characters and spaces, but the actual thing to type is not shown correctly by the Github markdown parser. After setting the issue description to edit mode I have seen the below:

image

But if you take a look at how GH parses the markdown, it is the same as the message. I cannot therefore consider this a bug

image

@minhth1529
Copy link

@MartinCupela it just show example, you can test that on you demo page

@MartinCupela
Copy link
Contributor

Yes, but it behaves as expected. See how it is rendered in this issue description

@MartinCupela
Copy link
Contributor

You are quoting something, so the white spaces will not be trimmed

@minhth1529
Copy link

I just typing: test. do not quote

@MartinCupela
Copy link
Contributor

Quoting in markdown is putting character > at the beginning of the line. That is what your issue description contains. Your last message is confusing.

@minhth1529
Copy link

oh That wasn't my intention, I just wanted it to appear similar to the demo

Screen.Recording.2024-11-14.at.9.25.28.PM.mov

@MartinCupela
Copy link
Contributor

                                                                                                                                                                                                                                 test

The same thing happens in GitHub as you can see above in this message

@MartinCupela
Copy link
Contributor

This is not a bug

@vihan85
Copy link
Author

vihan85 commented Nov 15, 2024

Hi @MartinCupela

You can watch the video below.

Why does a horizontal scroll bar appear instead of a line break?

Can you support line breaks like when entering a consecutive string that doesn't contain spaces?

Social.Messaging.Demo.-.Example.Messaging.App.mp4

@MartinCupela
Copy link
Contributor

MartinCupela commented Nov 15, 2024

Hey @vihan85 , the whitespace is not trimmed, because that is how MD is interpreted by the parser. It is by design. If you would like to change the behavior, I encourage you to provide your custom remark plugins. The guide is available here:

https://getstream.io/chat/docs/sdk/react/components/message-components/render-text/#custom-remark-and-rehype-plugins

You can take an inspiration from an existing plugin in the SDK:

https://github.com/GetStream/stream-chat-react/blob/master/src/components/Message/renderText/remarkPlugins/keepLineBreaksPlugin.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: unconfirmed
Projects
None yet
Development

No branches or pull requests

3 participants