-
Notifications
You must be signed in to change notification settings - Fork 6
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
Expose secondary block and character counter from ToucanForm for Input and Textarea #222
Conversation
🦋 Changeset detectedLatest commit: ff50f27 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
"@docfy/core": "^0.6.0", | ||
"@docfy/ember": "^0.6.0", |
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 had to bump these down as I was getting build errors (randomly) from docfy when running:
pnpm build
or
pnpm start
It's apparently not failing on CI though, which is weird. It was bumped by Renovate yesterday.
I didn't see a helpful error as to why, so I figure reverting for the time being is the path of least resistance. I'll pick this back up after other items come off of my plate.
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 was my PR that was part of the bump to version 0.7.0: josemarluedke/docfy#161
But there were also a lot of 3 dependabot updates...https://github.com/josemarluedke/docfy/pulls?q=is%3Apr+is%3Aclosed
Preview URLsEnv: preview |
907266e
to
b38ac3c
Compare
b38ac3c
to
ff50f27
Compare
A character counter is exposed via a `secondary` block. It can be combined with any of the other named blocks or label/hint arguments. | ||
|
||
```hbs | ||
<Form::Fields::Input class='w-full' @label='Label' @hint='With hint text'> |
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.
🚀 Thanks for adding this in!
...attributes | ||
> | ||
<:label>{{yield to='label'}}</:label> | ||
<:secondary as |secondary|> |
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.
Does this need a (has-block 'secondary')
wrapped around it?
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.
Sent a message about this, but we cannot conditionally render named blocks, so we have no way to do:
<Form::Fields::Textarea
@hint={{@hint}}
@error={{this.mapErrors field.rawErrors}}
@value={{this.assertString field.value}}
{{! @glint-expect-error }}
@onChange={{field.setValue}}
@isDisabled={{@isDisabled}}
@isReadOnly={{@isReadOnly}}
@rootTestSelector={{@rootTestSelector}}
name={{@name}}
...attributes
>
<:label>{{yield to='label'}}</:label>
{{#if (has-block "secondary")}}
<:secondary as |secondary|>
{{/if}}
So due to that we have the top-level {{#if (has-block 'secondary')}}
<secondary.CharacterCount @max={{255}} /> | ||
</:secondary> | ||
</Form::Fields::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.
Suggestion: it would be nice to have this in the changeset
demo...maybe as a follow up.
But then again, we don't have analytics (do we?) so we don't know which docs folks are looking at the most as an example...
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.
Yeah! Good suggestion! I was going to add this in the docs later. There's an issue I filed around maybe making components all full-width, otherwise the demo looks kinda funky. I'll work on this next week hopefully though!
🚀 Description
secondary
block to Input and Textarea🔬 How to Test
📸 Images/Videos of Functionality
N/A