-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: Input now support refs #123
Conversation
.prettierrc
Outdated
@@ -2,5 +2,6 @@ | |||
"semi": false, | |||
"singleQuote": true, | |||
"arrowParens": "avoid", | |||
"printWidth": 120 | |||
"printWidth": 120, | |||
"bracketSameLine": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This made some changes to files outside of the scope of this PR. I'm thinking on removing this and introducing it in a new PR 🤔
Let me know what you all think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea best to have linting updates in a separate pr where possible
I'm gonna cherry pick this PR cause the merging of next messed it up. |
…input-forward-ref # Conflicts: # src/assets/svg/alicorn.svg # src/components/icons/index.ts # src/components/index.ts # src/components/navigation/GlobalNavigation/WorkspaceSelector/WorkspaceSelector.tsx # src/components/navigation/GlobalNavigation/WorkspaceSelector/WorkspaceSelectorContent.tsx # src/components/navigation/GlobalNavigation/global-navigation.css # src/utils/utils.spec.ts
…aquarium into fix/input-forward-ref
…aquarium into fix/input-forward-ref
Input.Search = AntInput.Search | ||
Input.TextArea = AntInput.TextArea | ||
|
||
export { Input, type InputRef, type IInputProps } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why we need an index for Input only, cant this go in src/components/index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing these to see if we can use the already present index
@@ -17,10 +18,6 @@ import { useEffect } from 'react' | |||
import { useMemo } from 'react' | |||
import { debounce, hasImageAtSrc } from 'src/utils/utils' | |||
import { getInitials } from 'src/utils/utils' | |||
|
|||
// TODO: Need to make our Input component comply with forwardRef to be able to import it from src/components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise TODONE!
Input.Group = AntInput.Group | ||
Input.Password = AntInput.Password | ||
Input.Search = AntInput.Search | ||
Input.TextArea = AntInput.TextArea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to keep this in the Input file if we can.
…aquarium into fix/input-forward-ref
@tibuurcio spoilers - even linus doesnt "knows git properly" 😂 |
#169 fixed |
Summary
This PR adds support for using Refs in our Input component the same way Antd's native Input supports it. With this we are able to support implementations that need to control input focus.
Implementation was based on the one from Antd
Testing Plan
Aquarium._.Data.Entry._.Input.-.With.Focus.Management.Storybook.-.Google.Chrome.2024-03-01.19-04-06.mp4
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)