responsive not working in react
See original GitHub issueresponsive not working in react .
I created the editor as follows:
import React, { Component, Fragment , createRef} from "react";
// New
import suneditor from 'suneditor'
import plugins from 'suneditor/src/plugins'
import 'suneditor/dist/css/suneditor.min.css'
class Editor extends Component {
constructor(props) {
super(props);
this.state = {
EditMode : false,
};
this.txtArea = createRef();
}
componentDidMount() {
//New
this.SunEditor = suneditor.create(this.txtArea.current,{
buttonList: [
['undo', 'redo'],
['font', 'fontSize', 'formatBlock', 'align', 'lineHeight'],
['bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor'],
['removeFormat'],
['-right', ':i-More Misc-default.more_vertical', 'showBlocks', 'codeView', 'preview', 'print', 'save'],
['-right', ':r-More Rich-default.more_plus', 'horizontalRule', 'list', 'table'],
['-right', 'image', 'video', 'audio', 'link'],
// (min-width: 992)
['%1100', [
['undo', 'redo'],
['font', 'fontSize', 'formatBlock', 'align', 'lineHeight'],
['bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor'],
['removeFormat'],
['-right', ':i-More Misc-default.more_vertical', 'showBlocks', 'codeView', 'preview', 'print', 'save', 'fullScreen'],
['-right', ':r-More Rich-default.more_plus', 'image', 'video', 'audio', 'link', 'horizontalRule', 'list', 'table'],
]],
['%870', [
['undo', 'redo'],
['font', 'fontSize', 'formatBlock', 'align', 'lineHeight'],
[':t-More Text-default.more_text', 'bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor'],
['removeFormat'],
['-right', ':i-More Misc-default.more_vertical', 'showBlocks', 'codeView', 'preview', 'print', 'save', 'fullScreen'],
['-right', ':r-More Rich-default.more_plus', 'image', 'video', 'audio', 'link', 'horizontalRule', 'list', 'table'],
]],
['%660', [
['undo', 'redo'],
[':p-More Paragraph-default.more_paragraph', 'font', 'fontSize', 'formatBlock', 'align', 'lineHeight'],
[':t-More Text-default.more_text', 'bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor'],
['removeFormat'],
['-right', ':i-More Misc-default.more_vertical', 'showBlocks', 'codeView', 'preview', 'print', 'save', 'fullScreen'],
['-right', ':r-More Rich-default.more_plus', 'image', 'video', 'audio', 'link', 'horizontalRule', 'list', 'table'],
]],
['%335', [
['undo', 'redo'],
[':p-More Paragraph-default.more_paragraph', 'font', 'fontSize', 'formatBlock', 'align', 'lineHeight'],
[':t-More Text-default.more_text', 'bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor', 'removeFormat'],
['-right', ':i-More Misc-default.more_vertical', 'showBlocks', 'codeView', 'preview', 'print', 'save', 'fullScreen'],
['-right', ':r-More Rich-default.more_plus', 'image', 'video', 'audio', 'link', 'horizontalRule', 'list', 'table'],
]],
],
placeholder: this.props.placeholder ? this.props.placeholder : 'متن را وارد نمایید',
value :this.props.value,
plugins: plugins,
minHeight : 300,
charCounter: true,
font: [
'Vazir', 'Arial', 'Comic Sans MS', 'Courier New', 'Impact',
'Georgia', 'tahoma', 'Trebuchet MS', 'Verdana'
],
});
}
render() {
return (
<Fragment>
<textarea ref={this.txtArea}></textarea>
</Fragment>
);
}
}
export default Editor;
But the reactionary does not work properly.
But I see this result in the largest size :
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
React not responsive - Stack Overflow
So what I'm trying to do is display both the components when in desktop dimensions and display only the Login component when in...
Read more >React-responsive not working on first load - Support
Hi there, I have an issue which I assume is something to do with server-side-rendering with JAMstack but I can't work out how...
Read more >react-responsive - npm
Start using react-responsive in your project by running `npm i react-responsive`. There are 1047 other projects in the npm registry using ...
Read more >Issues · yocontra/react-responsive - GitHub
CSS media queries in react - for responsive design, and more. - Issues · yocontra/react-responsive.
Read more >3 Ways To Implement Responsive Design In Your React App
React has truly been a game changer in how we now approach developing ... cons could exacerbate due to higher complexity and lead...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I thought the width would be “100%”… “width” is also available as an option.
@JiHong88 hi The result of another attempt: I used iframe, but nothing changed. And it did not work as well as before. As before, when the inspector opens, the sizes are correct.
But what do you say about the width of the upper elements, It made me give textarea 100% width and everything was fine. Now the size of the editor is quite correct when loading and is quite responsive.
Thank you for your attention to the issues