-
Notifications
You must be signed in to change notification settings - Fork 2k
[WIP][lexical-playground] Feature: Add zoom functionality to editor #7468
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
base: main
Are you sure you want to change the base?
[WIP][lexical-playground] Feature: Add zoom functionality to editor #7468
Conversation
- Add zoom dropdown with Fit and percentage options (50-200%) - Implement CSS zoom-based content scaling - Add mobile-responsive zoom display - Calculate and apply Fit zoom option - Style zoom dropdown to match existing toolbar patterns Closes facebook#7467
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
- Replace non-standard zoom property with transform:scale() for better TypeScript support - Improve cross-browser compatibility in zoom functionality - Fix TS2339 error by removing dependency on CSSStyleDeclaration zoom property - Maintain same zoom levels and UX while using standard CSS transforms
Latest commit seems to have some issues for me (Mac, Chrome):
![]() Additional questions:
|
…cale"\n\nThis reverts commit 6eaa835.
- Add StyleWithZoom type to properly type the zoom CSS property - Use type assertion to handle non-standard zoom property in TypeScript - Fix TS2339 errors while maintaining existing zoom functionality
- Remove 'Fit' option from zoom levels - Simplify type to numeric-only zoom values - Remove unnecessary type checks and conditional logic - Clean up related code
- Remove text label from alignment dropdown button - Keep only icon display for cleaner toolbar UI - Maintain all alignment functionality while reducing visual clutter
Hi @takuyakanbr! Thanks for reviewing and reporting these issues! I've made some changes to address them:
These changes have been committed and pushed. Let me know if there's anything else that needs adjustment. |
- Update zoomLevel type in ToolbarContext to only use number
- Improve organization of zoom-related styles
Hmm I'm still seeing alignment issues with the action buttons on the left (the one that allows for adding empty paragraphs and dragging to reorder), when zoom isn't 100%. There are also some tests that we may need to modify to account for the changes to the alignment dropdown, e.g. those using This is more of a UI nit, but I think we can remove the divider that's directly on the left of the alignment dropdown. |
In Google Docs, option "Fit" reduces the white margins and scales the document content accordingly. So in Google Docs, "Fit" is not equivalent to "100%" |
Description
Current Behvior:
The playground editor doesn't have any zoom functionality, making it difficult for users to adjust content size for better readability or detailed editing.
This PR adds:
Closes #7467
Test plan
Before
No Zoom functionality
After
Desktop:
lexical-fix-7467.mov
Mobie: