Skip to content

Commit

Permalink
fix(Autocomplete): ensure value is not visible behind the trigger but…
Browse files Browse the repository at this point in the history
…ton (#1543)
  • Loading branch information
tujoworker authored Aug 31, 2022
1 parent 59ec706 commit de65acb
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const AutocompleteToggleExample = () => (
/* jsx */ `
<Autocomplete
label="Label:"
value={10}
show_submit_button={true}
on_change={({ data }) => {
console.log('on_change', data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2907,12 +2907,12 @@ legend.dnb-form-label {
z-index: 3;
cursor: text; }
@media screen and (min-width: 40em) {
.dnb-autocomplete .dnb-input--has-submit-element .dnb-input__placeholder,
.dnb-autocomplete .dnb-input--has-submit-element .dnb-input__input {
.dnb-autocomplete .dnb-input--has-inner-element .dnb-input__placeholder,
.dnb-autocomplete .dnb-input--has-inner-element .dnb-input__input {
padding-right: 0 !important; } }
@media screen and (max-width: 40em) {
.dnb-autocomplete .dnb-input--has-submit-element .dnb-input__placeholder,
.dnb-autocomplete .dnb-input--has-submit-element .dnb-input__input {
.dnb-autocomplete .dnb-input--has-inner-element .dnb-input__placeholder,
.dnb-autocomplete .dnb-input--has-inner-element .dnb-input__input {
padding-right: 2.5rem !important; } }
.dnb-autocomplete .dnb-input__inner__element.dnb-p {
white-space: nowrap;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
cursor: text;
}

&--has-submit-element .dnb-input__placeholder,
&--has-submit-element .dnb-input__input {
&--has-inner-element .dnb-input__placeholder,
&--has-inner-element .dnb-input__input {
@include allAbove(small) {
// same width of submit button
padding-right: 0 !important; // use important so we avoid to have all sizes in addition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,10 +1370,10 @@ exports[`Button scss have to match default theme snapshot 1`] = `
.dnb-button--signal[disabled] {
color: var(--color-black-20);
background-color: var(--color-accent-yellow-30); }
.dnb-button--input-button.dnb-button--secondary:not(.dnb-button--has-text), .dnb-button--input-button.dnb-button--secondary:not(.dnb-button--has-text):not([disabled]) {
.dnb-button--input-button.dnb-button--secondary:not(.dnb-button--has-text):not([disabled]) {
background-color: transparent;
box-shadow: none; }
.dnb-button--input-button.dnb-button--secondary:not(.dnb-button--has-text)::after, .dnb-button--input-button.dnb-button--secondary:not(.dnb-button--has-text):not([disabled])::after {
.dnb-button--input-button.dnb-button--secondary:not(.dnb-button--has-text):not([disabled])::after {
content: '';
position: absolute;
top: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@
}

// input-button
// Because we can not anymore have a square, we have to trick that part
&--input-button#{&}--secondary:not(&--has-text),
&--input-button#{&}--secondary:not(&--has-text):not([disabled]) {
// Because we can not anymore have a square, we have to trick that part
background-color: transparent;
box-shadow: none;

&::after {
content: '';
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions packages/dnb-eufemia/src/components/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export default class Input extends React.PureComponent {
`dnb-input--${type}`, //type_modifier
size && !sizeIsNumber && `dnb-input--${size}`,
hasSubmitButton && 'dnb-input--has-submit-element',
inner_element && 'dnb-input--has-inner-element',
isTrue(clear) && 'dnb-input--has-clear-button',
align && `dnb-input__align--${align}`,
status && `dnb-input__status--${status_state}`,
Expand Down

0 comments on commit de65acb

Please sign in to comment.