Skip to content

Commit

Permalink
Input text cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarParra committed Nov 1, 2023
1 parent 2abdc3b commit e2ef602
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,20 @@ This action navigates to a URL. A Map expression with a "name" property must be

This action reloads the page.

### Input Text

> `Form` compatible
The `Input Text` component allows you to display a text input. It can be used
in a community page.

#### Properties

- `Label` - The label to display.
- `Name` - Unique name for the input. This will be used as the key in the form data during submission.
- `Required` - Whether the input is required or not.
- `Error Message` - The error message to display when the input is required and empty.

### Nav Bar

The `Nav Bar` component allows you to display a navigation bar with links to other pages. It can be used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ export default class InputText extends TwElement {

@api
reportValidity() {
console.log('reportValidity', this.value);
if (this.required && !this.value) {
console.log('reportValidity', this.value, 'is invalid');
this.hasValidationError = true;
return false;
}
console.log('reportValidity', this.value, 'is valid');
this.hasValidationError = false;
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default class NavBar extends ExpressionSiteElement {
@api respectSharing;

isOpen = false;

toggle() {
this.isOpen = !this.isOpen;
}
Expand Down

0 comments on commit e2ef602

Please sign in to comment.