Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Fix hidden input placement - #946

Merged
benogle merged 6 commits into
masterfrom
bo-fix-hidden-input
Oct 10, 2013
Merged

benogle merged 6 commits into
masterfrom
bo-fix-hidden-input

Conversation

@benogle

@benogle benogle commented Oct 9, 2013

Copy link
Copy Markdown
Contributor

In the speedup work i've been doing, I changed the editor.hiddenInput to use the cursorView's style attribute rather than $.offset() because it is much faster. However the hiddenInput and the cursorView had different parents, so was placing the hidden input in the wrong spot. Occasionally the hiddenInput would get focus and scroll the scrollView which blanks the editor window.

Soooo, this moves the hiddenInput to the underlayer, and places it in the visible area when it's focused, keeping the speedup and mitigating the editor blank screen.

Regression from the speedup stuff
Also brings the input into view when the input is focused so we
dont scroll the scrollView and blank the editor
The test calls hiddenInput.focus(), but in reality, nothing external to
the editor can trigger this. I'd rather just have 
bringHiddenInputIntoView() called in one place, but this is insurance.
Comment thread src/editor.coffee Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How come you only need the px suffix on top and not left?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oversight

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants