mi6 / mi6/ic-ui-kit

[ic-radio-group] overriding orientation="horizontal" doesn't work

Open
#1,820 0 comments 0 reactions 1 assignee Claimed by @GCHQ-Developer-773 View on GitHub
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

## Summary of the bug
When you set orientation to horizontal on radio group but one of the radio options has a text field, or there's more than 2 radio options, it should set the orientation to vertical. This isn't currently working.

## 🪜 How to reproduce
Tell us the steps to reproduce the problem:
1. Go to storybook locally
2. Update radio conditional dynamic example to have orientation="horizontal"
4. See that it renders horizontal and not vertical

## 🧐 Expected behaviour
It should update to vertical for those use cases. It should also update if it runs out of space on the screen so might be worth checking resize observer code as well.

## Additional info
This test was removed due to failures, it should be added back in with this work:
```
it("should change the orientation of the radio group to vertical if the user has additional fields on any of the radio buttons in the group", async () => {
const page = await newSpecPage({
components: [RadioGroup, RadioOption, TextField],
html: `




`,
});

expect(page.rootInstance.currentOrientation).toMatch("vertical");
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.