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

Cursor jumps while editing EditableText inside a Dialog #15

Closed
cyu06 opened this issue Oct 28, 2016 · 1 comment
Closed

Cursor jumps while editing EditableText inside a Dialog #15

cyu06 opened this issue Oct 28, 2016 · 1 comment
Assignees

Comments

@cyu06
Copy link
Contributor

cyu06 commented Oct 28, 2016

Here's a fun one: if you have an EditableText component inside a Dialog, any change to the contents of the EditableText (inserting or deleting a character) moves the cursor to the end of the component. This makes it nearly impossible to use except if you're just typing contents at the end.

Reported by vshekhawat.

Modified repro:

import { Dialog, EditableText } from "../src";
import * as React from "react";

interface IReproState {
  text: string;
}

export class DialogExample extends React.Component<{}, IReproState> {
    public constructor() {
        super();
        this.state = {
            text: "",
        };
    }

    public render() {
        return (
            <Dialog isOpen>
                <EditableText
                    value={this.state.text}
                    onChange={this.setText}
                />
            </Dialog>
        );
    }

    private setText = (text: string) => {
        this.setState({
            text,
        });
    }
}
@cyu06
Copy link
Contributor Author

cyu06 commented Nov 8, 2016

This may be also impacting Table's examples. Unrelated

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

No branches or pull requests

1 participant