Skip to content

fix text color changes inconsistently when entering edit mode #1780

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

spartan-vutrannguyen
Copy link
Contributor

@spartan-vutrannguyen spartan-vutrannguyen commented Apr 14, 2025

Description

  • Fix text color changes inconsistently when entering edit mode
    Root cause:
  • The DOUBLE_CLICK action uses the getElementAtLoc function, which already passes true to include the styles object.
  • The ENTER action uses getDomElementByDomId, but it still needs to pass true to retrieve the styles object as well.

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Screen.Recording.2025-04-14.at.17.52.54.mp4

Additional Notes


Important

Fix inconsistent text color change in edit mode by updating getDomElementByDomId call and handling null URLs in Image.tsx.

  • Behavior:
    • Fix inconsistent text color change when entering edit mode by modifying getDomElementByDomId call in index.ts to include an additional parameter.
    • Ensure setSelectedImage(null) is called in Image.tsx when no URL is provided.
  • Files:
    • index.ts: Update getDomElementByDomId call to include true parameter.
    • Image.tsx: Add else block to set selectedImage to null when url is not provided.

This description was created by Ellipsis for c4e1f3e. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to c4e1f3e in 33 seconds

More details
  • Looked at 26 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. apps/studio/src/components/Modals/Settings/Site/Image.tsx:32
  • Draft comment:
    Using 'setSelectedImage(null)' in the else branch ensures the state resets when url is absent. This is a clear and safe fix.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. apps/studio/src/lib/editor/engine/text/index.ts:148
  • Draft comment:
    Passing the additional boolean argument (true) to getDomElementByDomId seems intentional to address the text color issue. Ensure the API expects this change.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. apps/studio/src/components/Modals/Settings/Site/Image.tsx:29
  • Draft comment:
    Good fix resetting selectedImage to null if no URL is provided. This prevents stale image data from persisting when the URL changes.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. apps/studio/src/lib/editor/engine/text/index.ts:147
  • Draft comment:
    Adding the second argument 'true' to getDomElementByDomId aligns with how getElementAtLoc is used. Ensure that the API change is intentional and consistent with expected behavior.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None

Workflow ID: wflow_Gpv6VSvqH4zCUy5l


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Kitenite Kitenite merged commit e77668f into main Apr 15, 2025
@Kitenite Kitenite deleted the fix/text-color-when-entering-edit-mode branch April 15, 2025 04:56
zongkelong pushed a commit to zongkelong/coolook that referenced this pull request Apr 15, 2025
* 'main' of https://github.com/onlook-dev/onlook:
  Resolve the functionality to duplicate a page that has been already duplicated (onlook-dev#1776)
  fix text color changes inconsistently when entering edit mode (onlook-dev#1780)
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.

[bug][elements] Text color changes inconsistently when entering edit mode
2 participants