• [ Moved to the Fixing WordPress sub-forum. ]

    When I type some text and with a keyboard shortcut I change it to H2 then the text gets selected. Is this new feature and intentional?
    If it is intentional, what is the purpose of it?
    If it is a bug can we get a fix?

    Because when I type some text and change it to H2, I then press enter so I can start typing a paragraph but since the header text is now selected it will delete it…

Viewing 6 replies - 1 through 6 (of 6 total)
  • In order to apply formatting, you need to select some text.
    If, after applying some formatting, this text remains selected, then that sounds like a good feature.
    Let’s say you want to apply both italic and bold: 1. Select text. 2. apply italic. 3. If you didn’t keep the selection, then you’d have to select the text again here!!!

    So your best way forward is probably to teach your muscle memory to always hit the right arrow after applying a header level.

    Good luck!

    Thread Starter filoveg

    (@filoveg)

    I never selected text. I write a title and when the cursor is still at the end of title I press SHIFT+ALT+2 so that the title quickly formats as H2, then I would press enter and continue writing everything as usual. This is much faster.
    It doesn’t have anything to do with previously selected text for applying bold and italics.

    • This reply was modified 8 years, 5 months ago by filoveg.

    In order to mark that H2, a script obviously detects that your current selection is 0 chars long, so it automatically expands the selection to the full row, before applying the format.
    And if that’s the way you prefer to do your writing (i.e. formatting as you’re writing), then you’ll have to get used to collapse the selection by hitting right arrow after applying a heading style.

    Or submit an idea to the TinyMCE community, that IF selection was expanded before applying a heading style, then selection should automatically be collapsed afterwards.
    https://community.tinymce.com/communityIdeasHome
    The only problem is that about the time this idea would trickle to a released version, WordPress may already be just about to migrate to the new Gutenberg editor…

    Thread Starter filoveg

    (@filoveg)

    This ‘feature’ was introduced with WordPress 4.8.
    I have just tested one website with WordPress version 4.6 and the other with 4.7.5, on both sites nothing gets selected after setting heading with a keyboard shortcut.
    I have been writing posts for years now and this although seems like a small thing for me it is kinda a frustrating one 🙂

    But ok… looking forward to Gutenberg editor

    WordPress 4.8 uses a later/newer version of TinyMCE.
    It’s possible that the WordPress developers also reviewed some additional parameters and combination of plugins for TinyMCE. I believe they reshuffled the buttons that are there for click-a-maniacs (unlike you 🙂 )

    If this is a big issue, then I guess it might be possible to create a plugin that would fix this for you. (But I’m certainly not the right person to do that…)

    Wish you and your muscle memory good luck in sorting out this.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Typing text and changing it to H1-h6 tag selects the text?’ is closed to new replies.