mi6 / mi6/ic-ui-kit

IcTextField and IcSelect interaction error

Open
#3,320 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

## Summary of the bug
When icTextField changes a state onBlur and IcSelect has no options, inputing text into the IcTextField then clicking directly to IcSelect creates an error.

## 🪜 How to reproduce
Tell us the steps to reproduce the problem:
1. IcTextField has value controlled by state and onIcBlur updates that state with current input
2. IcSelect has no options and is not disabled
3. Type any text into IcTextField input
4. click directly onto IcSelect
5. See error in console

## 📸 Screenshots or code
[stackblitz](https://stackblitz.com/edit/rrwnzmxu?file=src%2Fapp.jsx&hideExplorer=1)

## 🧐 Expected behaviour
When clicking from one element to another there should be no errors between the two

## Additional info
Error: Cannot read properties of null (reading 'contains')
Occurs at Menu.handleBlur

Contributor guide

Open the contributing guide

Research direction

Start with the StackBlitz reproduction in src/app.jsx and trace the Menu.handleBlur path used when moving from IcTextField to an empty IcSelect. Reproduce the interaction with controlled IcTextField state, then verify the transition produces no console error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.