Skip to content

Feature: Add zoom functionality to editor #7467

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

Open
kirandash opened this issue Apr 13, 2025 · 0 comments · May be fixed by #7468
Open

Feature: Add zoom functionality to editor #7467

kirandash opened this issue Apr 13, 2025 · 0 comments · May be fixed by #7468
Labels
enhancement Improvement over existing feature

Comments

@kirandash
Copy link
Contributor

Description

This feature request is related to #6449 where there's a discussion about making Playground's toolbar similar to Google Docs toolbar.

I'm working on making the editor more accessible and user-friendly, and would like to add zoom functionality similar to Google Docs. But a simpler one. This would allow users to adjust the editor's content size for better readability and editing experience.

Use cases:

  • Users who need larger text for better visibility
  • Users working on detailed content who need to zoom in for precision
  • Users who want to see more content at once by zooming out
  • Users who want content to fit their viewport width automatically

Alternative solutions considered:

  1. Complex implementation using CSS transform/scale (like Google Docs)
    • Pros: Better browser compatibility, more precise control
    • Cons: Significantly more complex, requires major changes
  2. Current simple implementation using CSS zoom property
    • Pros: Easy to implement, good performance, works well for basic use cases
    • Cons: Potential layout issues with complex content

Implementation details:

  • Add zoom dropdown in toolbar with options: Fit, 50%, 75%, 90%, 100%, 125%, 150%, 200%
  • "Fit" option should automatically calculate zoom to fit content width
  • Should work on both desktop and mobile views
  • Add a dropdown to toolbar that follows Lexical's existing dropdown UI patterns
@kirandash kirandash added the enhancement Improvement over existing feature label Apr 13, 2025
kirandash added a commit to bgwebagency/lexical that referenced this issue Apr 13, 2025
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement over existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant