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

fix API:subPanel.initial/fixedHeight #2874

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

NiklasGollenstede
Copy link
Contributor

Following #2865 I now tested the subPanel.initial/fixedHeight integration options, and the height was off.
Actually removing a bit of code fixes that. And it also makes more sense now. the mHeight eventually ends up being assigned directly to the subPanel <iframe>, which is what the height should be for.

@piroor
Copy link
Owner

piroor commented Apr 26, 2021

Hmm, I intentionally added the height of the sub panel, because:

  • It can be changed by some reasons - system font size, user styles, and more.
  • On the other hand, the height of sub panel contents can be controlled completely by the sub panel provider author.

If TST doesn't add the height of the header, sub panel contents may be cut off accidentally. How do you think about this point?

@NiklasGollenstede
Copy link
Contributor Author

What I changed is the computation of mHeight. Besides being saved, restored and capped, it is (I think only) used in these assignments:

const appliedHeight = Math.min(window.innerHeight * 0.66, mHeight);
mContainer.style.height = `${appliedHeight + headerSize}px`;
mSubPanel.style.height = `${appliedHeight}px`;
mTabBarContainer.style.bottom = `${appliedHeight + headerSize}px`;

Where mSubPanel is the iframe whose height I would be expecting to set with this API.
The mContainer does indeed need the additional headerSize`. But I think you were adding it twice before.

And I can tell you that it works now 🤷 (for me, at least)

@piroor piroor merged commit b9ba1db into piroor:trunk Apr 26, 2021
@piroor
Copy link
Owner

piroor commented Apr 26, 2021

Oops, sorry I completely misunderstood what I did... You are right, I didn't need to add the header size!

@NiklasGollenstede
Copy link
Contributor Author

Cooli!

By the way, (and not that I am urging you) but do you have an idea when you will publish this change?

@piroor
Copy link
Owner

piroor commented Apr 26, 2021

I think #2864 is a blocker for the new release, because some changes I already did can break accessibility and need to be tested.

@NiklasGollenstede
Copy link
Contributor Author

Ok. Thanks for the info!

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

Successfully merging this pull request may close these issues.

2 participants