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

Remove text-input Addon widget #1697

Merged
merged 5 commits into from
Mar 24, 2021
Merged

Remove text-input Addon widget #1697

merged 5 commits into from
Mar 24, 2021

Conversation

tomdye
Copy link
Member

@tomdye tomdye commented Mar 23, 2021

This PR removes the text-input Addon widget and makes it more user friendly.
You can now simply pass the leading / trailing dom node directly to the TextInput.

Resolves: #1695

@vercel
Copy link

vercel bot commented Mar 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

widget-test-docs – ./

🔍 Inspect: https://vercel.com/dojo/widget-test-docs/Gy92jP8wXeaM1hngYtN56vyugqDk
✅ Preview: https://widget-test-docs-git-fork-tomdye-text-input-addon-dojo1.vercel.app

dojo.widgets – ./

🔍 Inspect: https://vercel.com/dojo/dojo.widgets/CyftXDNLsmxAsevtD41My821D5Va
✅ Preview: https://dojowidgets-git-fork-tomdye-text-input-addon-dojo1.vercel.app

@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #1697 (316a470) into master (8bade73) will decrease coverage by 0.00%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1697      +/-   ##
==========================================
- Coverage   90.05%   90.05%   -0.01%     
==========================================
  Files          94       94              
  Lines        5050     5046       -4     
  Branches     1373     1374       +1     
==========================================
- Hits         4548     4544       -4     
  Misses        249      249              
  Partials      253      253              
Impacted Files Coverage Δ
src/password-input/index.tsx 78.57% <40.00%> (ø)
src/date-input/index.tsx 91.07% <100.00%> (ø)
src/text-input/index.tsx 92.68% <100.00%> (-0.24%) ⬇️
src/time-picker/index.tsx 81.81% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8bade73...316a470. Read the comment docs.

color: var(--color-text-faded);
flex: 0 0 auto;
font-size: inherit;
line-height: var(--line-height-base);
padding: 0 var(--grid-base);
/* padding: 0 var(--grid-base); */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to change this value here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to remove that

@samends
Copy link

samends commented Mar 23, 2021

Looks good Tom! What was the original thought behind the Addon widget?

@@ -606,12 +610,12 @@ registerSuite('TextInput', {
css.noLabel
])
.prepend('@inputWrapper', () => [leading]);
const h = harness(() => <TextInput>{{ leading }}</TextInput>);
const h = harness(() => <TextInput>{{ leading: <span>A</span> }}</TextInput>);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could probably get away with just using a text node instead of a full span.

Suggested change
const h = harness(() => <TextInput>{{ leading: <span>A</span> }}</TextInput>);
const h = harness(() => <TextInput>{{ leading: 'A' }}</TextInput>);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup yup, you are correct thought wanted to show that you can add domnodes as well as text

@@ -11,8 +10,8 @@ export default factory(function Basic() {
<NumberInput>
{{
label: 'Number Input',
leading: <Addon>$</Addon>,
trailing: <Addon filled>MM</Addon>
leading: <span>$</span>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should show users that they can pass text here. For most use cases that should be sufficient.

Suggested change
leading: <span>$</span>,
leading: '$',

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, though I have shown a mix of uses.

@tomdye
Copy link
Member Author

tomdye commented Mar 24, 2021

Looks good Tom! What was the original thought behind the Addon widget?

I believe it was to make the padding optional but this can be done better via theming etc now. The previous approach was awkward for custom elements.

@tomdye
Copy link
Member Author

tomdye commented Mar 24, 2021

@aciccarello comments addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextInput Addon approach re-work
3 participants