Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRP-3423: Add aria-own to prevent read parent page #1361

Merged
merged 2 commits into from
Dec 5, 2022
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The following is a curated list of changes in the Enact sandstone module, newest

### Fixed

- `sandstone/Input` to read out properly after closing it in a `sandstone/PopupTabLayout`
- `sandstone/ImageItem` to have proper size when imported with `sandstone/Dropdown` or `sandstone/VirtualList` in the same file
- `sandstone/MediaPlayer.MediaControls` to focus properly when pressing up key from buttons after holding left or right keys
- `sandstone/Scroller` and `sandstone/VirtualList` to scroll properly by hover when scrollbar is hidden or `dataSize` is changed
Expand Down
121 changes: 62 additions & 59 deletions Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,65 +394,68 @@ const InputPopupBase = kind({
delete rest.onOpenPopup;

return (
<Popup
aria-label={popupAriaLabel}
aria-labelledby={ariaLabelledBy}
onClose={onClose}
onShow={onShow}
position={popupType === 'fullscreen' ? 'fullscreen' : 'center'}
className={popupClassName}
noAlertRole
noAnimation
open={open}
role="region"
>
{popupType === 'fullscreen' ? backButton : null}
<Layout orientation="vertical" align={`center ${numberMode ? 'space-between' : ''}`} className={css.body}>
<Cell shrink className={css.titles}>
{popupType === 'fullscreen' ?
heading :
<>
{backButton}
{heading}
</>
}
<Heading id={`${id}_subtitle`} size="subtitle" marqueeOn="render" alignment="center" className={css.subtitle}>{subtitle}</Heading>
</Cell>
<Cell shrink className={css.inputArea}>
{numberMode ?
<NumberField
{...inputProps}
announce={announce}
maxLength={limitNumberLength(popupType, maxLength)}
minLength={limitNumberLength(popupType, minLength)}
defaultValue={value}
onBeforeChange={onBeforeChange}
onComplete={onNumberComplete}
showKeypad
type={(type === 'passwordnumber') ? 'password' : 'number'}
numberInputField={numberInputField}
noSubmitButton={noSubmitButton}
/> :
<InputField
{...inputProps}
className={classnames(css.textField, spotlightDefaultClass)}
css={css}
maxLength={maxLength}
minLength={minLength}
size={size}
autoFocus
type={type}
defaultValue={value}
placeholder={placeholder}
onBeforeChange={onBeforeChange}
onKeyDown={onInputKeyDown}
spotlightId={inputFieldSpotlightId}
/>
}
</Cell>
<Cell shrink className={css.buttonArea}>{children}</Cell>
</Layout>
</Popup>
<div aria-owns={id} className={css.inputPopupWrapper}>
<Popup
id={id}
aria-label={popupAriaLabel}
aria-labelledby={ariaLabelledBy}
onClose={onClose}
onShow={onShow}
position={popupType === 'fullscreen' ? 'fullscreen' : 'center'}
className={popupClassName}
noAlertRole
noAnimation
open={open}
role="region"
>
{popupType === 'fullscreen' ? backButton : null}
<Layout orientation="vertical" align={`center ${numberMode ? 'space-between' : ''}`} className={css.body}>
<Cell shrink className={css.titles}>
{popupType === 'fullscreen' ?
heading :
<>
{backButton}
{heading}
</>
}
<Heading id={`${id}_subtitle`} size="subtitle" marqueeOn="render" alignment="center" className={css.subtitle}>{subtitle}</Heading>
</Cell>
<Cell shrink className={css.inputArea}>
{numberMode ?
<NumberField
{...inputProps}
announce={announce}
maxLength={limitNumberLength(popupType, maxLength)}
minLength={limitNumberLength(popupType, minLength)}
defaultValue={value}
onBeforeChange={onBeforeChange}
onComplete={onNumberComplete}
showKeypad
type={(type === 'passwordnumber') ? 'password' : 'number'}
numberInputField={numberInputField}
noSubmitButton={noSubmitButton}
/> :
<InputField
{...inputProps}
className={classnames(css.textField, spotlightDefaultClass)}
css={css}
maxLength={maxLength}
minLength={minLength}
size={size}
autoFocus
type={type}
defaultValue={value}
placeholder={placeholder}
onBeforeChange={onBeforeChange}
onKeyDown={onInputKeyDown}
spotlightId={inputFieldSpotlightId}
/>
}
</Cell>
<Cell shrink className={css.buttonArea}>{children}</Cell>
</Layout>
</Popup>
</div>
);
}
});
Expand Down
4 changes: 4 additions & 0 deletions Input/Input.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
@import "../styles/skin.less";
@import "../styles/variables.less";

.inputPopupWrapper {
display: inline;
}

.popup {
.numberField,
.number,
Expand Down