Skip to content

Commit

Permalink
Added a qa-sample for chaning position while dropdown open
Browse files Browse the repository at this point in the history
Enact-DCO-1.0-Signed-off-by: Hyelyn Kim (myelyn.kim@lge.com)
  • Loading branch information
mmyelyn committed Jan 13, 2025
1 parent fb247af commit 4025763
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion samples/sampler/stories/qa/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {action} from '@enact/storybook-utils/addons/actions';
import {boolean, select, text} from '@enact/storybook-utils/addons/controls';
import UIButton, {ButtonBase as UIButtonBase} from '@enact/ui/Button';
import PropTypes from 'prop-types';
import {Component} from 'react';
import {Component, useEffect, useState} from 'react';

const Config = mergeComponentMetadata(
'Dropdown',
Expand Down Expand Up @@ -333,3 +333,28 @@ InScroller.parameters = {
};

InScroller.storyName = 'in Scroller (PLAT-137855)';

export const WithChaningPositionWhileDropdownOpen = () => {
const [isRemoved, remove] = useState(false);

useEffect(() => {
setTimeout(() => {
remove(true);
}, 2000);
}, []);

return (
<div>
{!isRemoved && (
<div style={{margin: '20px'}}>
<div>This is the line that will be removed.</div>
</div>
)}
<div>
<Dropdown open>{['a', 'b', 'c']}</Dropdown>
</div>
</div>
);
};

WithChaningPositionWhileDropdownOpen.storyName = 'with changing position while dropdown open';

0 comments on commit 4025763

Please sign in to comment.