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

feat(pte): add initialActive prop to PortableTextInput #6638

Merged
merged 3 commits into from
May 16, 2024
Merged

Conversation

robinpyon
Copy link
Contributor

Description

This PR adds initialActive to <PortableTextInput>.

This simply allows PTE inputs to be mounted without the need to manually 'activate' them by focusing beforehand.

This is used by Create as all PTE inputs there are always active by default.

What to review

Like other recent PTE changes brought in from Create, existing PTE inputs in the studio are unaffected. PTE inputs in the studio should still require activation by manually focusing / clicking them.

Testing

  • An additional example has been added to BlcokEditor examples in test-studio
  • A playwright component test has been added (some others covering hideToolbar and initialFullscreen have also been added)

Notes for release

N/A

Copy link

vercel bot commented May 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 9:07am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 9:07am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 9:07am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview May 16, 2024 9:07am

@robinpyon robinpyon changed the title feat(pte): add initialActive prop to `PortableTextInput feat(pte): add initialActive prop to PortableTextInput May 13, 2024
Copy link
Contributor

No changes to documentation

await $pteField
.locator(`[data-testid='pt-editor__toolbar-card']`)
.waitFor({state: 'visible', timeout: 1000})
await $overlay.waitFor({state: 'detached', timeout: 1000})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Minor change – note that we now check for the overlay to be detached as opposed to checking for toolbar visibility, since this can fail with PTE inputs with hideToolbar=true

Copy link
Contributor

github-actions bot commented May 13, 2024

Component Testing Report Updated May 16, 2024 9:12 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 14s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ❌ Failed (Inspect) 1m 7s 17 0 1
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 28s 12 0 0

@robinpyon
Copy link
Contributor Author

(Removed carolina as a reviewer as she's OOO)

jtpetty
jtpetty previously approved these changes May 15, 2024
Copy link
Contributor

@jtpetty jtpetty left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

3 participants