Skip to content

[Bug]: Caret Drift BUG repeating even after updating to ver 1.6.1 #2234

Description

@kb071216

Component

UI (ui.*)

Severity

P1 - High (major feature broken)

Shiny Version

1.6.1

Python Version

3.11.11

Minimal Reproducible Example

from shiny import App, Inputs, Outputs, Session, render, ui


app_ui = ui.page_fillable(
    ui.layout_columns(
        ui.card(
            ui.card_header("Python Code Editor"),
            ui.input_code_editor(
                "code",
                label="Enter Python code:",
                value="def greet(name):\n    return f'Hello, {name}!'\n\nprint(greet('World'))",
                language="sql",
                height="200px",
            ),
        ),
        ui.card(
            ui.card_header("Editor Value"),
            ui.output_text_verbatim("value", placeholder=True),
        ),
        col_widths=[6, 6],
    )
)


def server(input: Inputs, output: Outputs, session: Session):
    @render.text
    def value():
        return input.code()


app = App(app_ui, server)


if __name__ == "__main__":
    app.run()

Behavior

I have noticed that the BUG has been marked as fixed for shiny 1.6.1 but after testing, it looks like it has not been properly fixed.

Current: As I'm typing on the code editor, caret drifts to the right and becomes visually separated from the actual text insertion point. Caret DOES NOT match the actual insertion point where it should be.
Expected: The caret should stay visually aligned with the true insertion point while typing, regardless of how long the current line is.

Error Messages (if any)

Environment

Windows 11
Chrome 147.0.7727.102(Official Build) (64bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: MediumValid bug or well-defined request with moderate impact or a workaround.bugSomething isn't workingneeds clarificationMissing a specific expected behavior, environment detail, screenshot, log, or scope decision.needs-triageregressionEvidence that current or development behavior differs materially from an older released version.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions