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

[terra-popup] Changed disabledHeader to true as default #2171

Closed
wants to merge 8 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-framework-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Changed
* Enabled `close` button in examples.
*
## 1.90.0 - (May 22, 2024)

* Updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const PopupWithInteractiveContent = () => {
targetRef={getButtonNode}
onRequestClose={handleRequestClose}
contentHeight="auto"
isHeaderDisabled={false}
>
{/* eslint-disable-next-line react/forbid-dom-props */}
<div style={{ padding: '1em' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow was horizontally attached.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ArrowPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>this is popup content</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class OffsetPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup was adjusted because the target was smaller than the arrow position allowed.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class OffsetPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup was adjusted because the target was smaller than the arrow position allowed.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has vertical attachment.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has verital-left attachment, but was adjusted to be on the screen.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has vertical-right attachment, but was adjusted to be on the screen.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic height of 400px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic height of 400px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic width of 400px, but is bounded by the parent width of 200px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This is popup content with a automatic width of 400px.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class BoundedPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup is bounded by height.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class BoundedPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup is bounded and presents a header.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class BoundedPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup is bounded by width.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class DefaultPopup extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p>this is popup content</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class AlignmentPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p className={cx('popup-text')}>This popup arrow has vertical attachment.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DefaultPopup extends React.Component {
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
contentHeight="auto"
isHeaderDisabled={false}
>
<p>this is popup content</p>
<button id="button1" type="button">Test button 1</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class PopupWithContentWidth extends Component {
isOpen={open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p>This is a popup with custom contentWidth and contentHeight</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class PopupExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<TestPopupContent size={this.state.size} onClick={() => this.setState({ size: 'large' })} />
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DimensionPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>This popup defaults its size.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DimensionPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>This popup is 240h by 960w.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DimensionPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>This popup is 120h by 320w.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DimensionPopup extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handleRequestClose}
targetRef={this.getButtonNode}
isHeaderDisabled={false}
>
<p>This popup is 40h by 160w.</p>
</Popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ModalContent extends React.Component {
isOpen={this.state.open}
onRequestClose={this.handlePopupRequestClose}
targetRef={() => document.getElementById('popup-in-modal')}
isHeaderDisabled={false}
>
<p>This is popup content</p>
<button type="button">Test button 1</button>
Expand Down
3 changes: 3 additions & 0 deletions packages/terra-pills/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Added
* Enabled `close` button in Popup while opening from a pill.

## 1.29.0 - (May 22, 2024)

* Changed
Expand Down
1 change: 1 addition & 0 deletions packages/terra-pills/src/subcomponents/_Pill.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const Pill = (props) => {
targetRef={getPillRef}
onRequestClose={handleOnRequestClose}
contentHeight="auto"
isHeaderDisabled={false}
>
<div className={cx(['popup-content-pill-label', theme.className])}>
{labelCategory
Expand Down
3 changes: 3 additions & 0 deletions packages/terra-popup/CHANGELOG.md
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add a note to 6.84.0 that it has a breaking change that's corrected in 6.86.0

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Changed
* Disabled `close` button in popup by default.

## 6.85.0 - (May 22, 2024)

* Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-popup/src/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const defaultProps = {
contentWidth: '240',
isArrowDisplayed: false,
isContentFocusDisabled: false,
isHeaderDisabled: false,
isHeaderDisabled: true,
isOpen: false,
popupContentRole: 'dialog',
isMenu: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-popup/src/_PopupContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const defaultProps = {
contentHeightMax: -1,
contentWidthMax: -1,
isFocusedDisabled: false,
isHeaderDisabled: false,
isHeaderDisabled: true,
isHeightAutomatic: false,
isWidthAutomatic: false,
popupContentRole: 'dialog',
Expand Down
1 change: 1 addition & 0 deletions packages/terra-popup/tests/jest/PopupContent.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('PopupContent', () => {
contentWidth: 640,
onRequestClose: jest.fn(),
onResize: jest.fn(),
isHeaderDisabled: false,
};
const children = <div>children node(s)</div>;

Expand Down
1 change: 1 addition & 0 deletions packages/terra-popup/tests/jest/PopupDefaultExample.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class PopupDefaultExample extends React.Component {
isOpen={this.state.open}
targetRef={this.getButtonNode}
onRequestClose={this.handleRequestClose}
isHeaderDisabled={false}
>
<p>this is popup content</p>
</Popup>
Expand Down
Loading