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

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

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

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

tolmasky opened this issue Jun 14, 2011 · 12 comments

Comments

@tolmasky
Copy link
Member

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.

@nicomagni
Copy link

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

@Me1000
Copy link
Contributor

Me1000 commented Dec 29, 2011

I believe the fix is as simple as adding

[self scrollRectToVisible:[self frame]];

To -becomeFirstResponder

@cappbot
Copy link

cappbot commented May 9, 2012

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

@tolmasky
Copy link
Member Author

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.

@aljungberg
Copy link
Member

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.

@ggsato
Copy link
Contributor

ggsato commented May 24, 2012

+AppKit
+#needs-review

@cappbot
Copy link

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
will not scroll without the NSScrollView knowing about it
Issue cappuccino#1675 and maybe a little of issue cappuccino#1301
This fix will not work without pull
request cappuccino#1678 - Fixed scrollRectToVisible in CPView
@ahankinson
Copy link
Contributor

-#new

@cappbot
Copy link

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
Copy link

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.

@ahankinson
Copy link
Contributor

I believe this was fixed in 481f7c6

+#fixed

@cappbot
Copy link

cappbot commented Mar 14, 2013

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

@cappbot cappbot closed this as completed Mar 14, 2013
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

7 participants