In draft-js using the staticToolBarPlugin, why does changing styles for selected text move text to new line? - draftjs

So I will start out with this:
Solar Power
And then I bold, say, Solar, and I get this:
Solar
Power
Why does it go into a new line?

The issue was i had global css that messed it up. I had RNW flex styling applying to all elements, including the ones in the wysiwyg.

Related

How to remove this gray line that causes text to wrap in VS Code?

I've recently noticed that when typing out long lines of code, they split into multiple lines after this threshold and it bothers me. enter image description here
Not sure if it was a formatting extension that I put on here years ago, but I couldn't seem to locate it in the settings.
The grey line isn't what causes the wrapping. You can apply settings to have the grey line and not have wrapping. They grey line is displayed according to the editor.ruler setting.
In general text editor terminology, this wrapping you are observing is called "soft wrapping" (when an editor wraps long lines in its rendering of the text, but doesn't actually insert line-break characters, which is called "hard wrapping").
By default, soft-wrapping can be toggled by Alt+z (The command palette command is named View: Toggle Word Wrap).
The default setting of soft wrapping for VS Code is configurable by the editor.wordWrap setting. It has several values it can take on:
"bounded": lines wrap at the minimum of viewport width and editor.wordWrapColumn,
"off": Lines will never wrap
"on": Lines will wrap at the viewport width
"wordWrapColumn": Lines will wrap at editor.wordWrapColumn
The word wrap column is configurable by the editor.wordWrapColumn setting. See also the editor.wrappingIndent and wrappingStrategy settings.
This is a setting called rulers. Go into Settings and search "rulers". Then you will be able to edit the settings.json file. Under "editor.rulers" remove all values in the array so that it is empty. That should solve it.

Fillable Pdf multi-line, Allow rich text formatting in Acrobat Pro DC: but it ignores line spacing/leading set in More

I'm on Win10, using Acrobat Pro DC 2021.011... to edit and Reader DC (same version) to test.
From experience and from reading forums etc, forms in these apps are maddening... but I have not been able to find any discussion (or solutions) to the following behavior...
The form I'm building for other employees' use has a large edit text box set to Multi-line and Allow Rich Text Formatting. It is set to a default font, Calibri and size 50pt. For most situations this will work for them; provides 2-3 lines for a short product description. But occasionally they want a smaller font and more lines... They know how to get the ctrl+e properties bar. But in my testing of this alternative situation they'll need sometimes, I'm finding it's impossible to get the smaller font size and more lines to work. Here's my process.
tab into text box. Ctrl+E for properties bar.
before typing I set the font size to 24
then I type in my 4 lines of text
then I tab to my next form field...
and kaboom... the field I just filled...it's line height is so large it's pushed some of the content invisible. I assume this is coming from the field's default font size, 50
And if I try to adjust the line height, by selecting all the text and then choosing in More...>Form Field Text Properties>Paragraph>Line Spacing
If I set it to Single and click Close/click into another field I get the very large leading (presumably for 50pt font (same as pic above after point 5)
If I choose Exactly and set to point size slightly larger, click Close/out of field, I get another ridiculous result where the 2/3 line have the height I set, but the space between the 1 & 2 second line is way too much and the space between the last line and 3rd line is way too small...
before tabbing or clicking out of field to another field
Good lord.. what is that! 3 different leading values in the same field; just after applying 1 value to all lines, all text in the field...
It makes no sense... it doesn't look like it regards your input at all, and just comes up with it's own random leading... I've fiddled with Space before/after and combinations of Line Height and nothing comes close to what we need... At this point I'm convinced the Acrobat tools for a stylizing text in a multi-line, allow formatting text field are useless. I'd be better off with my employees they can't format anything, ever. Just type one line and hit Tab or Enter...
What is going on! I'm trying to make a simple fillable form for other employees to use, but this kind of behavior makes that impossible (It's enough of a stretch to teach them to use the ctrl+E and do some styling of their text but this is bonkers and completely unteachable... there's not rhyme or pattern to teach!)
Hope someone can help or has seen this behavior too.

Line Spacing react-draft-wysiwyg

I want to implement Line Spacing options (single,double, exactly ,line per inch) in react-draft-wysiwyg editor but currently i don't think that it is support Custom line spacing , Open Issue , problem statement is i want to apply different line spacing on different paragraphs as per user input how i should be able to implement this feature ?
By changing line height of editor it will apply line height on whole editor but i want to be specific on user selected paragraphs
The solution is to set blockData and in render via blockstylefn set the correct style to block.
Take a look at these:
https://github.com/facebook/draft-js/issues/248#issuecomment-335010079
https://gist.github.com/joshdover/7c5e61ed68cc5552dc8a25463e357960.

Add HTML but not in text mode of TinyMCE

I have a big text and like to highlight words that are trademarks. So within this big CDATA node I need to grab for multiple words like "ACME Soda Chips" and make them red.
currently I do something like this in a TinyMCE plugin:
// almost ...
var foo = editor.getContent();
foo.replace('ACME Soda Chips', '<span class="douh">ACME Soda Chips</span>');
editor.setContent(foo);
My problem now is, that such HTML is displayed in Text-Mode (where you see the content as plain HTML) and also submitted therefor stored to the database.
But what I like to have is:
Highlight a word in the visual mode
Do not store my surrounding span somehow
Optional: Do not show that I used a span and CSS-class to highlight things.
Hint:
I may completely do this wrong - please help.
I read some other plugins and honestly I don't understand what they do.
Imagine the whole text as one single big CDATA part but I like to highlight a specific set out of it.

Avoid losing format after selecting all text and start typing

We use TinyMCE as the wysiwyg editor for our content builder. You can drag and drop a text module and once you click an edit button an TinyMCE instance will open. This works really well.
Problem is now that the builder is made for designers so a lot of the times you add a text module just for a 1 word heading or other cases where you only have one block. (one h1, one p etc.) You can also see this behavior in the official demos: Just add an lonely h2 heading, select all text and start to write.
Now Tiny MCE has the default behavior that if you select the complete text (which is almost always the case if you for example change an 1 line / word heading) and you start typing you will lose your formats completely. ( in our case: color, font-size, font-weight, line-height etc.)
This makes editing an heading for example really painful. Best workaround so far is to leave 1 character to not lose the format and then delete the character in the end.
I never saw that behavior in other editors so my question is: Is there maybe an easy setting or workaround to avoid this?
If there are situations where you want a root element to be something specific (e.g. <h2>) you can use the forced_root_block setting on that instance of TinyMCE to force a specific element:
https://www.tinymce.com/docs/configure/content-filtering/#forced_root_block
Even if you delete all text the new text will be wrapped with that root element. See this TinyMCE Fiddle for examples:
http://fiddle.tinymce.com/SOfaab
I think this would address your one line issue?