React reverse engineering facebook / messenger chat input - facebook

I'm trying to recreate with React the chat input of facebook / messenger.
Until now, I understand that the chat input is a custom input for typing messages build with a <div /> where the attribute contentEditable set to true. This custom input grows up with a min-height to a maximum height.
Once the maximum height is reached, the custom input set a scrollbar to scroll his content.
I'm trying to figure out how this is handled with props of the custom input and the state of his mother component but I don't really see how to do it properly.
Is there a way, a tutorial or something else to do it ? Or to have good behaviours of the chat input ?

Related

Flutter: How to do responsiveness for "real" mobile/web applications?

I saw many articles and videos on how to do responsive design in flutter.
But they all have in common, that they show a standard web page with menu, pictures, text.
What I call "real" in the title, means a full interactive application, so with displaying tables of data, providing input fields and other input elements, showing charts, ... - so all the interaction of a "real" application, not just a web site.
Simple example: If I have a large data table on a desktop screen, it has to be different on a mobile screen to show data in a way, the user can read it and use it sensibly.
So, how do I make the app responsive for all screen sizes without having to implement something twice or have case distinctions all over the place?
Refractor codes into widgets. (very important to reduce boiler plates)
Create an idea on how the webpage will look like based on 12 grid system
In build method check for screen size and return layout based on the screen size.
Please note
The widgets should be responsive by itself based on the size available. For example a chart widget. It should build a chart within the space provided by its parent.
There may be instances where in desktop some elements are in a row and the same element will be in a column in mobile. So you can also write sections like banner section (define web and phone layout), about us section etc so its easier to manage
Use wrap widget to automatically bring widgets down based on screen size
Use BoxConstrains and max width to control a Containers max width
For tables you can use packages like responsive tables

Is there any valid way to show an input without a border in SAPUI5?

I am working on a SAPUI5 app in which we do not want to add custom css to. Currently we are displaying text in a form which does not have the same height and styling as the inputs.
I'd prefer to change the text to an input with a pre-filled value so everything in the form has consistent styling but I need to differentiate that this should be treated as text.
The easiest way to do this is to remove the border but I cannot find away of doing this without creating custom css.
I tried borderDesign="None" but this does not affect inputs.

Angular UI Bootstrap typeahead does not extend past parent div border like a normal select dropdown

I'm using the Angular UI Bootstrap typeahead to display a customized list of suggestions as the user types into a text input form control. This form control exists inside a div using jQuery slimScroll in order to maintain a constant div size despite the size of its contents fluctuating. I really hoped the typeahead would display over everything like a regular html select dropdown, but unfortunately it does not, as can be seen in this plunker. I've tried futzing around with the z-index and adjusting the position and display properties; all fruitless endeavors.
Does anybody know how to get the typeahead popup to display over its parent border? If not, is there a way I could coerce the select tag to display HTML content so I can include glyphicons, emphasized text, etc. in the list of suggestions?
The problem is with the slim scroll - you are inside a div with relative position and overflow hidden (think of it as an iFrame). There is a small workaround...
You could, essentially set the position of the generated UL (.dropdown-menu) to fixed, set a height for it, then set an overflow:scroll...
It would work in some scenarios where the input field has a fixed position... otherwise you'd need to control where the input is and adjust the position of the auto-complete to follow, and a whole other bunch of nasty scripts.
Without looking at your application, I cannot understand why your have this particular architecture, but I can say that there must be cleaner options for handling autocomplete outside of slimscroll.
I just set typeahead-append-to-body="true" on the typeahead control and it worked. Not sure exactly why, but it's certainly a simple solution.

Bootstrap adaptive Form not playing nice with Kendo multiselect

I am using "Bootstrap responsive form" (http://www.bootply.com/jrNvaahcOh) and Kendomultiselect (http://demos.telerik.com/kendo-ui/multiselect/index)
The Bootstrap form scales the whole form, adapting the placement (and width) of form fields based on screen size.
My example works with the form only: http://jsfiddle.net/52VtD/12239/
It does
Draw the adaptive form
Wait 2 seconds
Activate Kendomultiselect (problem here!)
Problem: When there are two columns of form fields (I assume it breaks whenever the kendomultiselect is rightmost), the Kendomultiselect messes up the "flow" of design -> It seems like the next element get's thrown off it's proper placement and is not where it should be.
The Kendo Code that activates the simple html select is
$("#food").kendoMultiSelect().data("kendoMultiSelect");
..currently setup with timeout of 2 seconds to show the effect in my example.
Can anyone point out why this happens? I can only assume Bootstrap's css has problems with Kendo's css.

Use rems in Facebook Page Plugin

I want to set up Page Plugin on my website to display nicely on screens with a variety of resolutions and pixel densities. In order to truly achieve that, I'd have to have to possibility to use rems in data-width attribute. Unfortunately, when I enter a rem value, the data-width attribute is ignored.
Is there a way to make the plugin behave nicely with rems?
To make the Facebook Page Plugin responsive on initial page load, instead of using rems, you'll want to remove the data-width attribute and instead add
data-adapt-container-width="true"
This will make the Facebook Page Plugin responsive, but only on the initial page render, with a minimum width of 180px.
I'm still trying to figure out how to make it truly dynamically responsive, in spite of Facebook's caveat (I'll post an update if I ever find the answer).
No Dynamic Resizing
The Page plugin works with responsive, fluid and static layouts. You
can use media queries or other methods to set the width of the parent
element, yet:
The plugin will determine its width on page load.
It will not react changes to the box model after page load.
If you want to adjust the
plugin's width on window resize, you manually need to rerender the
plugin.
Source: https://developers.facebook.com/docs/plugins/page-plugin
You could make it dynamically responsive by reinitializing the widget on browser resize, but by doing that you run the risk of eating up memory very quickly.
There is some other stuff you can try here as well
Responsive width Facebook Page Plugin