Comments (6)
@Rushsoul What exactly do you mean by "send them as it is"?
Do you want to get DOMTree from contentediable div as a onSend callback param? If so, what do you want to achieve by this?
from chat-ui-kit-react.
May be they want to copy image and paste it
from chat-ui-kit-react.
@startupgurukul I'dont know. I'm waiting for a reply from @Rushsoul :)
from chat-ui-kit-react.
i am sorry that i haven't replied, i came out from the organization so , i don't know weather it is solved or not there.
from chat-ui-kit-react.
@startupgurukul I'dont know. I'm waiting for a reply from @Rushsoul :)
i will tell u the problem, lets se in all other message applications when we paste some link and send in chat, it will be sent as link only , i mean receiver no need to copy that link, by just clicking on it, it will open that link in chrome.
from chat-ui-kit-react.
@Rushsoul Ok, I understand now what you want to achieve.
But now in onSend callback you are getting innerHTML of message input.
So if user copy a link from notepad, or from website by choosing "copy link address" from right-click context menu, this link is copied to buffer as clear text.
When user paste this link to message input, this is also pasted as clear text without html "A" tag and you will get it in callback also as clear text.
In other case when user mark some linked text on website and do CTRL+C on keyboard this is copied as HTML to buffer.
When user paste this link to message input, this is pasted as html code with A tag and you will get it in callback as html.
I think, you are talking about first case. But it's up to you to process message received as a clear text, find link in it and wrap this link in html A tag.
This library is UI library and has nothing to do with text processing.
Moreover you should always sanitize all pasted content, because it's potentialy dangerous (it can contains dangerous scripts, or it just might ruin your layout).
Please never send direct html without sanitization to other user.
And one more important thing:
When you send copied html link directly without any processing, you don't know what you send. So if this link have target="_self" when your remote user click on this link it will be opened in the same browser window, so your chat application will gone. This is probably not expected behaviour :)
That's why you should always keep an eye on what you send and display.
from chat-ui-kit-react.
Related Issues (20)
- MessageGroup.Footer with Avatar looks odd
- Expose onKeyPress for MessageInput
- Allow using send button when there is no message text HOT 3
- Scroll to message on browser-native find
- Regarding Chat Reply UI of one another user HOT 1
- IOS 16 version issue of clicking button as Message.CustomContent HOT 3
- Unexpected overflow on ChatContainer HOT 2
- transitionning between the chatcontainer and the sidebar in mobile display HOT 3
- Simple styling with tailwind
- Unexpected width and height change inside components in Message.HtmlContent. HOT 1
- [HELP] How to use the streaming message feature? HOT 4
- Not working on Next.js HOT 4
- Bug: unable to use scroll bar when using custom css HOT 1
- The requested module '/node_modules/prop-types/index.js' does not provide an export named 'default' HOT 1
- Getting started!
- Warning from FontAwesomeIcon about using defaultProps
- Set message input value from another component HOT 1
- Is there a way to actually set a proper max-length for MessageInput? HOT 1
- Avatar isn't displayed when custom content is used
- Sass deprecation warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chat-ui-kit-react.