Skip to content

Commit

Permalink
Add the decription for Textbox
Browse files Browse the repository at this point in the history
This is for ziolko#25
  • Loading branch information
pcorpet committed Apr 11, 2022
1 parent 3edc3f8 commit 04bbaa7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/view/renderers/TextBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const ValidityIcon = styled.span<{ invalid: boolean }>`

export default observer(function TextBox({ node }: ComponentProps) {
const [ref, style] = useFocusable(node);
const description = node.description
let value = node.attributes.htmlValue;

if (node.htmlTag === "input" && node.attributes.htmlType === "password") {
Expand All @@ -65,10 +66,17 @@ export default observer(function TextBox({ node }: ComponentProps) {
<HorizontalBlockTemplate header={node.role ?? `<${node.htmlTag}>`} ref={ref} node={node}>
{node.hasCustomAccessibleName && (
<>
<HeaderPart>{node.accessibleName}</HeaderPart>{" "}
<HeaderPart>
{node.accessibleName}
</HeaderPart>{" "}
</>
)}
{spinButtonRange}
{description && (
node.isFocused ?
<HeaderPart>- {description} </HeaderPart> :
<HeaderPart title={description}>🛈 </HeaderPart>
)}
{spinButtonRange}
<HeaderPart>
{node.attributes.ariaRequired && "⭐"} <ValidityIcon invalid={!!node.attributes.ariaInvalid} />
</HeaderPart>
Expand Down

0 comments on commit 04bbaa7

Please sign in to comment.