NativeScript-Drop-Down icon indicating copy to clipboard operation
NativeScript-Drop-Down copied to clipboard

Arrow disappears after applying border style

Open YeshanJay opened this issue 8 years ago • 4 comments

Hi, The arrow on the widget disappears after applying border styles on it. See the images below. Is there any way to keep both border and arrow?

CSS style:

DropDown {
    margin: 10;
    padding: 2 2;
    font-size: 16;

    border-color: #000;
    border-width: 1;
    border-style: solid;
}

Without border: dd_noborder

With border: dd_border

YeshanJay avatar May 03 '17 05:05 YeshanJay

Hey @YeshanJay , this is a known limitation of the spinner android widget (not relative to {N}).

As a workaround you can wrap the drop down in a StackLayout with horizontalAlignment="stretch" and apply the border on the layout.

PeterStaev avatar May 03 '17 20:05 PeterStaev

Hi @PeterStaev , Thanks a lot for the workaround. Makes me wonder why I couldn't think of that.. lol 😄

YeshanJay avatar May 04 '17 04:05 YeshanJay

How do you get rid of the underline within the dropdown (see image)? Tried the CSS to set bottom border to none but doesn't do anything. Would be nice to get rid of it:

image

  <StackLayout class="input-field">
    <Label text="Type" class="label font-weight-bold m-b-5" textWrap="true"></Label>
    <StackLayout horizontalAlignment="stretch" class="input input-border">
      <DropDown [disabled]="!isEditMode()" #ddtype [items]="typeSelectionItems" [(ngModel)]="typeSelectionIndex" [hint]="hint"
        (selectedIndexChanged)="onTypeSelectionChange($event)" backroundColor="white" color="black" class="drop-down">
      </DropDown>
    </StackLayout>
  </StackLayout>

.drop-down{ border: none; text-decoration: none; border-bottom-width: 0; border-bottom-color: white; border-bottom: none; }

DBhail avatar Oct 12 '17 08:10 DBhail

@DBhail the border is a default android style of the spinner. You can remove it AND the indicator on the right by using the hack to apply a border to the element:

.drop-down {
    border-color: white;
    border-width: 1;
    border-style: solid;
}

PeterStaev avatar Oct 12 '17 09:10 PeterStaev