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

Incorrect focus behavior when Visibility == Visibility.COLLAPSE #4

Open
hannsl opened this issue Dec 10, 2011 · 2 comments
Open

Incorrect focus behavior when Visibility == Visibility.COLLAPSE #4

hannsl opened this issue Dec 10, 2011 · 2 comments

Comments

@hannsl
Copy link

hannsl commented Dec 10, 2011

When a style's visibility is set to Visibility.COLLAPSE, the associated field paints and lays itself out correctly, but its focus behavior is incorrect. For example, in the case of a vertical field manager, the manager's subfields are no longer visible but they are focusable.

@hannsl
Copy link
Author

hannsl commented Dec 10, 2011

In order to workaround the issue temporarily I added the following method to FieldDelegate

public static boolean isVisible(Field field) {
    return isVisible(getStyle(field));
}   

and overrode the isFocusable method in the manager implementations as

public boolean isFocusable() {
    return FieldDelegate.isVisible(this);
}

This workaround fixes the issue, but the next issue was that I received a lot of the following warnings in the console:
WARNING: Cannot layout field, insufficient height or width

In order to remove the warnings, I modified ManagerDelegate.sublayout as follows:

public static void sublayout(int maxWidth, int maxHeight, Manager manager) {
    if (manager instanceof GzManager) {
        GzManager gzManager = (GzManager) manager;
        if (!FieldDelegate.isVisible(manager)) {
            gzManager.gz_setExtent(0, 0);
            return;
        }

@infamous1982
Copy link
Member

Touché. On it.

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

No branches or pull requests

2 participants