reactist icon indicating copy to clipboard operation
reactist copied to clipboard

feat: Field and textarea components improvements

Open gnapse opened this issue 3 years ago • 1 comments

Short description

A handful of improvements and fixes related to field components. Most prominently:

  1. Allow them to render without a label.
    • This was already technically possible, but it rendered a gap at the top of the component, the spacing between it and its labels. That gap is now gone if there are no labels to render.
    • The label prop is still not optional. Users must be explicit about not wanting a label by passing label="" or label={null}
  2. Add tests for TextArea and a couple of fixes uncovered by the new tests.
    • See CHANGELOG for details

PR Checklist

  • [x] Added tests for bugs / new features
  • [x] Updated docs (storybooks, readme)
  • [x] Executed npm run validate and made sure no errors / warnings were shown
  • [x] Described changes in CHANGELOG.md
  • [ ] Bumped version in package.json and package-lock.json (npm --no-git-tag-version version <major|minor|patch>) ref
  • [ ] Updated all static build artifacts (npm run build-all)

Versioning

This will be merged and queued to an upcoming release.

The changes here are not breaking. This PR on its own should involve a minor release, as it only introduces fixes and a new feature (the removal of the gap, making the labelless field possibility official).

Demo

BeforeAfter
CleanShot 2022-08-15 at 13 27 59@2x CleanShot 2022-08-15 at 13 28 37@2x

gnapse avatar Aug 15 '22 18:08 gnapse

@frankieyan I added you as an additional reviewer in case this can still make it to the upcoming release you'll be making of Reactist. But if this is not approved by the time you have to release, feel free to ignore this, as it is low priority for now.

gnapse avatar Aug 15 '22 18:08 gnapse