Skip to content

Commit

Permalink
[RTL] Add auto direction prop on text-area component
Browse files Browse the repository at this point in the history
  • Loading branch information
dgurjar committed Jun 4, 2024
1 parent b411b58 commit 47c1a41
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,23 @@
validationStatus="valid"/>
<fd:events jcr:primaryType="nt:unstructured"/>
</textinput_1477533951>
<textinput_278740740
jcr:created="{Date}2024-06-03T16:41:36.206+05:30"
jcr:createdBy="admin"
jcr:lastModified="{Date}2024-06-03T16:41:55.103+05:30"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Text Input with multiple line"
sling:resourceType="forms-components-examples/components/form/textinput"
enabled="{Boolean}true"
fieldType="text-input"
hideTitle="false"
multiLine="true"
name="textinput_2787407401717413096406"
readOnly="{Boolean}false"
textIsRich="[true,true,true]"
unboundFormElement="{Boolean}false"
visible="{Boolean}true"/>
</guideContainer>
</jcr:content>
</jcr:root>
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
placeholder="${text.placeHolder}"
autocomplete="${text.autoComplete}"
minlength="${text.minLength}"
maxlength="${text.maxLength}"></textarea>
maxlength="${text.maxLength}"
dir="auto"></textarea>
<input data-sly-test="${!useTextarea}"
title="${text.tooltipVisible ? '' : text.tooltipText}"
class="cmp-adaptiveform-textinput__widget"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe("Form Runtime with Text Input", () => {
const [textbox7, textBox7FieldView] = Object.entries(formContainer._fields)[6];
const [textbox8, textBox8FieldView] = Object.entries(formContainer._fields)[7];

const [submitbutton1, fieldView] = Object.entries(formContainer._fields)[11]
const [submitbutton1, fieldView] = Object.entries(formContainer._fields)[12]

// 1. Required
cy.get(`#${textbox6}`).find("input").focus().blur().then(x => {
Expand Down Expand Up @@ -299,6 +299,12 @@ describe("Form Runtime with Text Input", () => {
})
}
});

// check for dir attribute in text area
it("should have dir attribute in text area", () => {
const [id, fieldView] = Object.entries(formContainer._fields)[11]
cy.get(`#${id}`).find("textarea").invoke('attr', 'dir').should('eq', 'auto');
});
})

describe("Form Runtime with Text Input For Different locale", () => {
Expand Down Expand Up @@ -361,5 +367,6 @@ describe("setFocus on text field via rules", () => {
cy.get(`#${id}`).should('have.class', 'cmp-adaptiveform-textinput--filled');
});
});

})

0 comments on commit 47c1a41

Please sign in to comment.