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

isHidden wrongly reports elements with display:contents as hidden #687

Open
justdanpo opened this issue Dec 26, 2024 · 0 comments
Open

isHidden wrongly reports elements with display:contents as hidden #687

justdanpo opened this issue Dec 26, 2024 · 0 comments

Comments

@justdanpo
Copy link

Is this a regression?

No

Description

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

isHidden wrongly reports elements with display:contents as hidden

Expected behavior

an element with display:contents should be treated as hidden only when all its children are hidden

Minimal reproduction of the problem with instructions

import { Component } from '@angular/core';
import { createComponentFactory, Spectator } from '@ngneat/spectator';

@Component({
    selector: 'test',
    template: '<div id="container"><div id="inner">text</div></div>',
    styles: '#container { display: contents; }',
})
class TestComponent {}

describe('isHidden', () => {
    const createFn = createComponentFactory(TestComponent);
    let spectator: Spectator<TestComponent>;
    beforeEach(() => {
        spectator = createFn({});
    });

    it('should work', () => {
        spectator.detectChanges();
        const el = spectator.query('#inner');
        expect(el).toBeVisible();
        expect(el).not.toBeHidden();
    });
});

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

No

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

1 participant