diff --git a/src/core/base/root.ts b/src/core/base/root.ts
index 870d4251..febd9d85 100644
--- a/src/core/base/root.ts
+++ b/src/core/base/root.ts
@@ -31,7 +31,7 @@ export class UIPRoot extends ESLBaseElement {
* Attribute for controlling preview's content direction.
* Has two values: `LTR` and `RTL`.
*/
- @attr({defaultValue: 'LTR'}) public direction: string;
+ @attr({defaultValue: 'ltr'}) public direction: string;
/**
* Attribute for setup media query rules
diff --git a/src/core/preview/preview.ts b/src/core/preview/preview.ts
index 9a782046..f054c772 100644
--- a/src/core/preview/preview.ts
+++ b/src/core/preview/preview.ts
@@ -8,13 +8,6 @@ import {UIPPlugin} from '../base/plugin';
export class UIPPreview extends UIPPlugin {
static is = 'uip-preview';
- protected connectedCallback() {
- super.connectedCallback();
- if (this.root) this.$inner.dir = this.root.direction;
-
- this.bindEvents();
- }
-
@bind
protected _onRootStateChange(): void {
if (this.$inner.parentElement === this) this.removeChild(this.$inner);
@@ -22,24 +15,8 @@ export class UIPPreview extends UIPPlugin {
this.appendChild(this.$inner);
}
- protected bindEvents() {
- this.root?.addEventListener('uip:configchange', this._onRootConfigChange);
- }
-
- protected unbindEvents() {
- this.root?.removeEventListener('uip:configchange', this._onRootConfigChange);
- }
-
- /** Callback to catch direction changes from {@link UIPRoot}. */
- @bind
- protected _onRootConfigChange(e: CustomEvent) {
- if (e.detail.attribute !== 'direction') return false;
- this.$inner.dir = e.detail.value;
- }
-
protected disconnectedCallback() {
if (this.$inner.parentElement === this) this.removeChild(this.$inner);
- this.unbindEvents();
super.disconnectedCallback();
}
}
diff --git a/src/plugins/options/README.md b/src/plugins/options/README.md
index ce1b1a3a..99451d5d 100644
--- a/src/plugins/options/README.md
+++ b/src/plugins/options/README.md
@@ -9,12 +9,12 @@ Extends [UIPPlugin](src/core/base/README.md#uip-plugin).
- **Theme** can be *light* (default) and *dark*. It sets color theme for other elements.
- **Mode** can be *vertical* (default) and *horizontal*. It controls UIP container's layout.
-- **Direction** can be *LTR* (default) and *RTL*. It changes the direction of preview's content.
+- **Direction** can be *ltr* (default) and *rtl*. It changes the direction of preview's content.
These options can be manually set (and observed) with corresponding attributes:
```html
-