LWC lightning-input component type autocomplete injects extra quotes

Issue #2643 open
Tony White created an issue

When using the auto complete for type on a lightning-input it adds extra quotes when you change it from one type to another, eg going from type=”datetime” to type=”date”

<lightning-input label="Date of Completion"
                 type=""date""
                 name="Case.Date_of_Completion__c">
                 </lightning-input>

Comments (2)

  1. Scott Wells repo owner
    • changed status to open

    Sorry for the delay. I've been very focused on getting this week's build out.

    Yeah, this is an annoying issue for which I haven't yet found a proper solution. Without going into too much detail, it has to do with how IC2 provides a dynamic XSD to the IDE's XML/HTML tag system, specifically around attributes that are constrained by an enumerated set of values.

    What I've found to make this more palatable is to set Generated quote marks in the HTML code style settings to None...which actually improves the behavior when you sometimes want to use a braced expression as the attribute value and sometimes want to use a quoted string literal. When configured this way, quoted enumerated attribute values are inserted properly except when trying to complete within an existing quoted string literal.

    It's not a perfect "fix" by any means, but it's the best option I've found so far. I'll keep looking, though...

  2. Log in to comment