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 caret class on root #94

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Conversation

Tidyzq
Copy link
Contributor

@Tidyzq Tidyzq commented Sep 14, 2023

regElem({
    is: 'comp',
    options: {
        styleScope: componentSpace.styleScopeManager.register('c'),
    },
    template: '<div id="c" class="c ^c1 ^^c2 ~c3" />',
})
var elem = createElem('comp')

expect(elem.$.c.$$.getAttribute('class')).toBe('c--c c--c1 c--c2 c--c3')
// expected 'c--c c--c1 c--c2 c--c3'
// got 'c--c c1 c--c2 c--c3'

Fixed the issue above, which got wrong style scope when the numbers of ^ exactly equals the depth in shadow tree.

Also refactored the constructor of ClassList for decoupling.

@Tidyzq Tidyzq merged commit a3488f5 into wechat-miniprogram:master Sep 14, 2023
2 of 4 checks passed
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.

None yet

2 participants