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(elements-angular): directives matching multiple components #1215

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ValueAccessorDirective } from './value-accessor.directive';

@Directive({
selector: 'ino-input-file,input[type=file]',
selector: 'ino-input-file,ino-input[type=file]',
providers: [
{
provide: NG_VALUE_ACCESSOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ValueAccessorDirective } from "./value-accessor.directive";

@Directive({
selector: 'ino-input[type=number], ino-range:not([ranged])',
selector: 'ino-input[type=number],ino-range:not([ranged])',
providers: [
{
provide: NG_VALUE_ACCESSOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ValueAccessorDirective } from './value-accessor.directive';

@Directive({
selector:
'ino-autocomplete,ino-currency-input,ino-input,ino-markdown-editor,ino-textarea,ino-range,ino-select,ino-datepicker,ino-segment-group',
'ino-autocomplete,ino-currency-input,ino-input:not([type=number]):not([type=file]),ino-markdown-editor,ino-textarea,ino-select,ino-datepicker,ino-segment-group',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For using multiply :not() selectors I suggest writing it like here:
https://developer.mozilla.org/en-US/blog/css-not-pseudo-multiple-selectors/#negating_multiple_selectors

Copy link
Collaborator Author

@janivo janivo Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just tried to add some simple jest test to the package but I think as long as we've got these conflicts with stencils outdated Jest version, I don't see us adding any new tests soon. I'll write that down in ticket #1224.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your suggestion about the selectors but that's currently not supported in angular:
image

providers: [
{
provide: NG_VALUE_ACCESSOR,
Expand Down
Loading