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

All day header out of sync with main schedule body after browser zoom #1253

Closed
matsbryntse opened this issue Jul 28, 2020 · 4 comments
Closed
Assignees
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@matsbryntse
Copy link
Member

Screenshot 2020-07-28 at 14 23 20

@matsbryntse matsbryntse added the bug Something isn't working label Jul 28, 2020
@matsbryntse matsbryntse changed the title All day header out of sync with main schedule body after zoom All day header out of sync with main schedule body after browser zoom Jul 28, 2020
@ExtAnimal
Copy link

calendar.modes.week.scrollable.hasScrollbar() is somehow returning false, so the header row is no longer accounting for the visible vertical scrollbar in the detail view, so each column is out of step by scrollbarWidth / 7 pixels.

Have to check how hasScrollbar functions when zoomed.

@ExtAnimal
Copy link

Needs:

    hasScrollbar(axis = 'y') {
        const { element } = this;

        if (element && DomHelper.scrollBarWidth) {
            const
                vertical   = axis === 'y',
                dimension  = vertical ? 'Width' : 'Height',
                clientSize = element[`client${dimension}`],
                borderSize = parseInt(DomHelper.getStyleValue(element, `border${vertical ? 'Left' : 'Top'}Width`)) + parseInt(DomHelper.getStyleValue(element, `border${vertical ? 'Right' : 'Bottom'}Width`)),
                difference = ((element[`offset${dimension}`] - borderSize) - clientSize) * window.devicePixelRatio; //<-

            // If the difference between the content width and the client width is
            // scrollBarWidth, then we have a scrollbar
            return Math.abs(difference - DomHelper.scrollBarWidth) < 2;
        }
    }

@ExtAnimal
Copy link

Hm no. That accounts for zooming happening after the scrollbar width has been read as 15. Zoom change should uncache scrollbarWidth so that it gets recalculated.

Unfortunately, there's no reliable way to detect zoom. So then getScrollbarWidth will have to cache the devicePixelRatio at the time of measuring, and then when called again, see if it's changed, and if so, uncache the scrollbarWidth so that it measures it at the new zoom setting.

@ExtAnimal ExtAnimal self-assigned this Aug 24, 2020
@ExtAnimal
Copy link

@matsbryntse matsbryntse added this to the Calendar 4.0.0 milestone Aug 24, 2020
@ExtAnimal ExtAnimal added the resolved Fixed but not yet released (available in the nightly builds) label Aug 27, 2020
@SergeyMaltsev SergeyMaltsev modified the milestones: Calendar 4.0.0, 4.0.0 Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

3 participants