Repository navigation
Forms block: add a layout attribute (stacked / inline) - #917
Merged
Merged
Conversation
- block.json: layout enum (stacked | inline), default stacked. - edit.tsx: Layout toggle in Form settings; the canvas preview puts fields and the button on one wrapping row when inline. - FormBlock: validateAttrs keeps only valid layouts; render adds data-layout="inline" and is-layout-inline only when inline, so stacked output is byte-identical. Placeholders are unchanged. - save.tsx returns null (dynamic block), so no deprecation is needed. - React/Vue renderers don't render artisanpack/form; no parity change. Closes #916
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Forms block (
artisanpack/form) gets a Layout setting: Stacked (the default) or Inline.Closes: #916
Type of Change
Related Issue
Issue: #916
Motivation and Context
Short forms such as newsletter signups need the email field and submit button on one row. The forms package now supports
layout: 'inline'(ArtisanPack-UI/forms#141, PR #142), and the host island reads it from the wrapper (Keystone #423, MR !308).Changes Made
block.json: newlayoutattribute (stacked|inline, defaultstacked).edit.tsx:flex: 1 1 12rem; min-width: min(12rem, 100%), button bottom-aligned).FormBlock.php:validateAttrs()keepslayoutonly when it'sstackedorinline.render()addsis-layout-inlineanddata-layout="inline"only when inline, so stacked output is byte-identical.artisanpack/form, so there's no parity change.How Has This Been Tested?
Testing Environment:
release/1.15.2Tests Performed:
npm run buildandnpm run build:libsucceed.is-layout-inline/data-layout="inline", and the email field and button sit on one row (wrapping at 375px, no horizontal scroll).Accessibility Tests Run
Details: Layout-only. The inspector control is a standard toggle group with a visible label and help text.
Tests Added
Documentation
Documentation details: CHANGELOG entry.
docs/blocks.mdlists the Forms block without attributes, so it's unchanged. The.potfile is regenerated at release time; the new strings are "Layout", "Stacked", "Inline" and the help text.Pre-Submission Checklist