Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the text directionality of TinyMCE impacts the whole interface #9672

Closed
Chouby opened this issue Sep 6, 2018 · 5 comments
Closed
Labels
[Block] Classic Affects the Classic Editor Block Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Milestone

Comments

@Chouby
Copy link
Contributor

Chouby commented Sep 6, 2018

On a multilingual site, it's possible that a writer has his interface in one language and writes posts in another language, possibly with a different text direction. For example, I can have the interface in English and need to write posts in Arabic. In that case I will want to change the text direction only in the editor.

With Gutenberg, changing the text directionality of Tiny MCE also impacts the text direction of the interface when I would expect it to change the text direction only in Tiny MCE.

Steps to reproduce the behavior:

  1. Create a plugin with this code snippet:
add_filter( 'tiny_mce_before_init', function( $mce_init ) {
	$mce_init['directionality'] = 'rtl';
	return $mce_init;
} );
  1. Edit a post with Gutenberg

Here is a screenshot with Gutenberg. The rtl text direction is unexpectedly applied everywhere:
screenshot-gutenberg

Here is the screenshot with the classic editor. The rtl text direction is applied only to Tiny MCE as expected:
screenshot-classic-editor

Related: #138

@tofumatt tofumatt added the [Type] Bug An existing feature does not function as intended label Sep 6, 2018
@designsimply designsimply added [Component] TinyMCE Needs Testing Needs further testing to be confirmed. labels Sep 6, 2018
@ellatrix
Copy link
Member

Huh.

@designsimply
Copy link
Member

Tested and confirmed using WordPress 4.9.8 and Gutenberg 4.2.0-rc.1 that adding the following snippet (I cheated and added it to the bottom of an existing) plugin results in the whole interface getting affected after the classic block is added.

add_filter( 'tiny_mce_before_init', function( $mce_init ) {
	$mce_init['directionality'] = 'rtl';
	return $mce_init;
} );

screen shot 2018-11-03 at 9 14 52 am
Seen at http://alittletestblog.com/wp-admin/post.php?post=15501&action=edit running WordPress 4.9.8 and Gutenberg 4.2.0-rc.1 using Firefox 63.0 on macOS 10.13.6.

Aside: I also spotted lots of 500 errors for API calls to autosave after making this change and adding a classic block:

{"code":"empty_content","message":"Content, title, and excerpt are empty.","data":null}

screen shot 2018-11-03 at 9 19 50 am

@designsimply designsimply added [Block] Classic Affects the Classic Editor Block and removed Needs Testing Needs further testing to be confirmed. labels Nov 3, 2018
@ellatrix ellatrix changed the title Changing the text directionality of Tiny MCE impacts the whole interface Changing the text directionality of TinyMCE impacts the whole interface Nov 27, 2018
@jorgefilipecosta
Copy link
Member

With the last version of WordPress and Gutenberg 5.8, the problem is still happening. The interface does not becomes in RTL right away but as soon as a classic block is added everything becomes RTL.

@jorgefilipecosta jorgefilipecosta added the Internationalization (i18n) Issues or PRs related to internationalization efforts label Jun 6, 2019
@paaljoachim
Copy link
Contributor

Hi @Chouby and @designsimply
Can you please retest using the newest version of WordPress and Gutenberg plugin.
How can we move this issue onward?

@glendaviesnz
Copy link
Contributor

With moving the classic block to a modal in block theme this is no longer a problem so closing.
Screenshot 2023-04-13 at 1 41 13 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Classic Affects the Classic Editor Block Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

8 participants