Skip to content

Commit

Permalink
fix(select.tsx, select.scss): fixed UI bugs for next line input
Browse files Browse the repository at this point in the history
Fixed width for input element for multi-select
  • Loading branch information
Asif Ahmed authored and asif-ahmed-1990 committed May 27, 2020
1 parent f09e54c commit 151671d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/datepicker/datepicker.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ describe('fw-datepicker', () => {
const updateEle = await page.find('fw-datepicker >>> fw-button.update-date-value');
await updateEle.click();

const datePicketValue = await element.getProperty('value');
const datePickerValue = await element.getProperty('value');
const todayValue = moment().format('YYYY-MM-DD');

expect(datePicketValue.toString()).toBe(todayValue.toString());
expect(datePickerValue.toString()).toBe(todayValue.toString());
});

it('daterange picker calenders always should be sequential months ', async () => {
Expand Down
7 changes: 5 additions & 2 deletions src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,23 @@ label {

// Input Container Style
.input-container-inner {
display: block;
display: flex;
width: 100%;
flex-wrap: wrap;
position: relative;

input {
flex-grow: 1;
border: none;
margin-top: 3px;
font-size: var(--font-size-12);
font-weight: var(--font-weight-500);
letter-spacing: 0;
line-height: 1.4;
background-color: var(--input-bg);
width: 100%;
min-width: 20px;
box-sizing: border-box;
overflow: hidden;

&:focus {
border: none;
Expand Down
4 changes: 3 additions & 1 deletion src/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export class Select {
}
return option;
});
this.selectInput.value = '';
this.renderInput();
this.closeDropdown();
selectedItem.stopPropagation();
}
Expand Down Expand Up @@ -179,7 +181,7 @@ export class Select {
if (selectedOptions.length > 0) {
this.value = this.multiple ? selectedOptions.map(option => option.value) : selectedOptions[0].value || '';
if (this.selectInput) {
this.selectInput.value = this.multiple ? '' : selectedOptions[0].text || '';
this.selectInput.value = this.multiple ? this.selectInput.value : selectedOptions[0].text || '';
}
} else if (selectedOptions.length === 0) {
this.value = undefined;
Expand Down

0 comments on commit 151671d

Please sign in to comment.