Skip to content

bug: v7 input, do not show highlight in item without ion-label #27763

@denys5dev

Description

@denys5dev

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Issue Summary:
When using ion-input within ion-item, and not add ion-label element - states(css classes) such as "focus", "disabled", and "invalid" are not set to ion-item element, it can lead to problems with setting highlight variables and other related functionalities. In the ionic 6 works as expected.

// working as expected
<ion-item lines="full">
  <ion-label></ion-label>
  <ion-input></ion-input>
</ion-item>

// not working
<ion-item lines="full" >
  <ion-input></ion-input>
</ion-item>
css:

ion-item {
  --highlight-height: 2px;
  --highlight-color-focused: #43e7f3;
  --highlight-color-valid: #6f58d8;
  --highlight-color-invalid: #ff46be;
}

Expected Behavior

--highlight-color-focused: #43e7f3;
--highlight-color-valid: #6f58d8;
--highlight-color-invalid: #ff46be;

should work without using ion-label element

Steps to Reproduce

  1. create
  1. set focus inside input

3.inspect ion-item element classes in devtools

Code Reproduction URL

https://stackblitz.com/edit/angular-6xeqay?file=src%2Fapp%2Fexample.component.html

Ionic Info

Ionic:
Ionic CLI : 7.1.1
Ionic Framework : @ionic/angular 7.1.2
@angular-devkit/build-angular : 16.1.0
@angular-devkit/schematics : 16.1.0
@angular/cli : 16.1.3

Capacitor:
Capacitor CLI : 5.0.5
@capacitor/android : 5.0.5
@capacitor/core : 5.0.5
@capacitor/ios : 5.0.5

Utility:
cordova-res : not installed globally
native-run : 1.7.2

System:
NodeJS : v18.16.1
npm : 9.5.1
OS : macOS Unknown

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: replythe issue needs a response from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions