Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-form-select] Combobox custom placeholder remove #3953

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/terra-core-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Updated
* Updated the Upgrade Guide for `terra-form-combobox`.

## 1.49.0 - (November 3, 2023)

* Updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ To upgrade from 5.0 to 6.0 each existing Select must be reviewed and updated to

### Breaking Changes

* Removed support for custom placeholder on the `combobox`
* Removed `boundingRef`
* Removed `isPlaceholderHidden`
* Removed `name`
Expand Down
3 changes: 3 additions & 0 deletions packages/terra-form-select/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Breaking Change
* Removed support for custom placeholder on the `combobox`.

* Added
* Added No results found text in `terra-form-select-combobox`.

Expand Down
21 changes: 3 additions & 18 deletions packages/terra-form-select/src/Combobox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ const propTypes = {
* Callback function invoked for each option on search change. function(searchValue, option)
*/
optionFilter: PropTypes.func,
/**
* Placeholder text.
*/
placeholder: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is breaking change !! we need to update the upgrade guide and change log entry with title Breaking Change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

/**
* Whether the field is required.
*/
Expand Down Expand Up @@ -122,7 +118,6 @@ const defaultProps = {
onSearch: undefined,
onSelect: undefined,
optionFilter: undefined,
placeholder: undefined,
required: false,
value: undefined,
inputId: undefined,
Expand Down Expand Up @@ -200,20 +195,10 @@ class Combobox extends React.Component {

render() {
const {
allowClear, children, defaultValue, onChange, placeholder, required, value, intl, inputId, ...otherProps
allowClear, children, defaultValue, onChange, required, value, intl, inputId, ...otherProps
} = this.props;

const defaultPlaceholder = intl.formatMessage({ id: 'Terra.form.select.defaultDisplay' });
const selectPlaceholder = placeholder === undefined ? defaultPlaceholder : placeholder;
let clearOptionDisplay;

if (allowClear) {
if (selectPlaceholder.length === 0) {
clearOptionDisplay = defaultPlaceholder;
} else {
clearOptionDisplay = selectPlaceholder;
}
}

return (
<Frame
Expand All @@ -223,10 +208,10 @@ class Combobox extends React.Component {
display={this.display()}
onDeselect={this.handleDeselect}
onSelect={this.handleSelect}
placeholder={selectPlaceholder}
placeholder={defaultPlaceholder}
required={required}
totalOptions={SelectUtil.getTotalNumberOfOptions(children)}
clearOptionDisplay={clearOptionDisplay}
clearOptionDisplay={defaultPlaceholder}
inputId={inputId}
>
{this.state.tags}
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/terra-form-select/tests/wdio/select-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ Terra.describeViewports('Select', ['tiny'], () => {
it('combobox input should be focused', () => {
expect($('[data-terra-select] input')).toBeFocused();

Terra.validates.element('is-touch-accessible-tab-focus', { selector: '#root' });
Terra.validates.element('combobox-is-touch-accessible-tab-focus', { selector: '#root' });
});

after(() => {
Expand Down
Loading