ScrollView should scroll to textfield when focused (or not). #1301

Closed
tolmasky opened this Issue Jun 14, 2011 · 12 comments

Comments

Projects
None yet
7 participants
Member

tolmasky commented Jun 14, 2011

If we have a textfield within a scrollview, giving it focus scrolls the underlying div, but does not actually scroll the scrollview (the scrollers show the old position, etc). As such, we should either make the scrollview match the new position, OR prevent the underlying div from scrolling.

Did anyone fix this? I have a big form with a scroll view.. how can I fix it?

Contributor

Me1000 commented Dec 29, 2011

I believe the fix is as simple as adding

[self scrollRectToVisible:[self frame]];

To -becomeFirstResponder

cappbot commented May 9, 2012

Label: #new. What's next? A reviewer should examine this issue.

Member

tolmasky commented May 9, 2012

This problem was a little more subtle. Its not just about calling scrollRectToVisible. The issue is that the underlying textfield DOM element, when focused, will scroll the parent div no matter what, so basically there is a situation where the divs could be out of sync with what cappuccino thinks is the state of the world.

Owner

aljungberg commented May 9, 2012

Automatic scrolling by the browser is very difficult to prevent I found out: http://stackoverflow.com/questions/2467386/how-can-safari-be-prevented-from-scrolling-an-overflowhidden-iframe

That's about iframes, but I wouldn't be surprised if it's similarly hard to stop the browser here.

Contributor

ggsato commented May 24, 2012

+AppKit
+#needs-review

cappbot commented May 24, 2012

Labels: #needs-review, #new, AppKit. What's next? This issue is pending an architectural or implementation design decision and should be discussed or voted on.

mrcarlberg added a commit to mrcarlberg/cappuccino that referenced this issue Sep 28, 2012

Make sure the text field is visible before focus so the browser
will not scroll without the NSScrollView knowing about it
Issue #1675 and maybe a little of issue #1301
This fix will not work without pull
request #1678 - Fixed scrollRectToVisible in CPView
Contributor

ahankinson commented Feb 15, 2013

-#new

cappbot commented Feb 15, 2013

Labels: #needs-review, AppKit. What's next? This issue is pending an architectural or implementation design decision and should be discussed or voted on.

cappbot commented Feb 17, 2013

Milestone: Someday. Labels: #needs-review, AppKit. What's next? This issue is pending an architectural or implementation design decision and should be discussed or voted on.

Contributor

ahankinson commented Mar 14, 2013

I believe this was fixed in 481f7c6

+#fixed

cappbot commented Mar 14, 2013

Milestone: Someday. Labels: #fixed, AppKit. What's next? This issue is considered successfully resolved.

@cappbot cappbot closed this Mar 14, 2013

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