-
Notifications
You must be signed in to change notification settings - Fork 183
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
[LOOM-1296][withOpenEvents]: Place openable
styling within BpkInput
#3408
Conversation
openable
styling within BpkInput
Visit https://backpack.github.io/storybook-prs/3408 to see this build running in a browser. |
import STYLES from './BpkInput.module.scss'; | ||
|
||
const getClassName = cssModules(STYLES); | ||
import { wrapDisplayName } from '../../bpk-react-utils'; |
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.
What's this being used for?
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.
Nice I see! That's very cool!
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.
We used to use recompose
for this but it was deprecated a long time ago so moved to simple code locally as no other replacement was available
I think it's going to be a challenge for HOC's where they're purpose is to wrap elements, which can then change anything about them. I'm happy with this solution. The |
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.
Ship it!
…#3408) * remove className application from withOpenEvents * update snaps
…#3408) * remove className application from withOpenEvents * update snaps
Place
openable
styling within BpkInput.data-
attribute field we can signal to BpkInput styling that it should be rendered with acursor: pointer
.Why not use a regular prop?
withOpenEvents
HOC)withOpenEvents
inside BpkInput) and control that behaviour through props.An alternative could be:
openable
prop to BpkINputwithOpenEvents
controls just theopenable
propcursor
stylingThe above seems like a much larger change, so thought before I'd embark on that to get some feedback on the above first.
Remember to include the following changes:
[KOA-123][BpkButton] Updating the colour
README.md
(If you have created a new component)README.md
.d.ts
) files updated