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

[Listbox] Hide input that documentation claims is hidden #570

Merged
merged 3 commits into from May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/listbox/__tests__/listbox.test.tsx
Expand Up @@ -196,7 +196,7 @@ describe("<Listbox />", () => {
<ListboxOption value="lengua">Lengua</ListboxOption>
</Listbox>
);
expect(container.querySelector("input")).toBeTruthy();
expect(container.querySelector("input")).not.toBeVisible();
});
});

Expand All @@ -218,7 +218,8 @@ describe("<Listbox />", () => {
</Listbox>
</div>
);
expect(container.querySelector("input")).toBeTruthy();
// Make sure to get the second input (not the one added in the test)
expect(container.querySelectorAll("input")[1]).not.toBeVisible();
});
});

Expand All @@ -231,7 +232,7 @@ describe("<Listbox />", () => {
<ListboxOption value="lengua">Lengua</ListboxOption>
</Listbox>
);
expect(container.querySelector("input")).toBeTruthy();
expect(container.querySelector("input")).not.toBeVisible();
expect(container.querySelector("input")).toHaveAttribute("required");
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/listbox/src/index.tsx
Expand Up @@ -331,7 +331,7 @@ export const ListboxInput = forwardRef<
readOnly
required={required}
tabIndex={-1}
type="text"
type="hidden"
value={state.context.value || ""}
/>
)}
Expand Down