cancel
Showing results for 
Search instead for 
Did you mean: 

addStyleClass for UI5 mobile - Bug?

0 Kudos

Dear all,

not sure if that is a bug or my miss-understanding things.

I'm trying to dynamically change the style of a sap.m.Input control using the addStyleClass method, with no result

When using the "normal" UI5  (sap.ui.commons.TextField (commented code)) things work as expected (the style is applied)

var tripTo = new sap.m.Input("tripInput" ,{ placeholder: "e.g. Berlin"});

//var tripTo =  new sap.ui.commons.TextField("tripInput" ,{ placeholder: "e.g. Berlin"}); --> working code

tripTo.addStyleClass("context-autofill");

When looking a bit into the HTML it appears the using the mobile control (sap.m.Input) the style is added to the <div> containing the <input> (marked red below), while it should be added to the <input> (marked blue below)

<div id="tripInput" data-sap-ui="tripInput" style="width: 100%;" class="context-autofill sapMInput sapMInputBase sapMInputBaseCursor">

  <input id="tripInput-inner" placeholder="e.g. Berlin" tabindex="0" value="" type="text" class="context-autofill sapMInputBaseInner">

</div>

I belief this is a bug, but maybe I'm using it wrong. Any Ideas?

Axel

PS: Where can I submit bugs?


Accepted Solutions (0)

Answers (1)

Answers (1)

former_member198357
Participant
0 Kudos

Hi Axel,

Could you please let me know whether you are able to resolve this issue.

Regards,

Bhavin