[MM 62088] Browse channels modal: Clear 'x' button is misaligned and related ux improvements (#29729)

Этот коммит содержится в:
M-ZubairAhmed
2025-01-06 00:50:44 +05:30
коммит произвёл GitHub
родитель 148dff2c24
Коммит 854d0e8b25
7 изменённых файлов: 34 добавлений и 37 удалений

Просмотреть файл

@@ -9,24 +9,24 @@
.input-clear { .input-clear {
top: 16px; top: 16px;
right: 46px; right: 14px;
} }
#searchIcon { #searchIcon {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
top: 16px; top: 16px;
left: 46px; left: 42px;
color: rgba(var(--center-channel-color-rgb), 0.64); color: rgba(var(--center-channel-color-rgb), 0.64);
pointer-events: none; pointer-events: none;
} }
#searchChannelsTextbox { #searchChannelsTextbox {
height: 48px; height: 48px;
padding-left: 40px;
border: 1px solid rgba(var(--center-channel-color-rgb), 0.16); border: 1px solid rgba(var(--center-channel-color-rgb), 0.16);
box-shadow: none; box-shadow: none;
font-size: 16px; font-size: 16px;
padding-inline: 40px;
&::placeholder { &::placeholder {
color: var(--center-channel-color); color: var(--center-channel-color);
@@ -250,6 +250,7 @@
margin-top: 8px; margin-top: 8px;
color: var(--center-channel-color); color: var(--center-channel-color);
line-height: 28px; line-height: 28px;
word-wrap: break-word;
} }
.secondary-message { .secondary-message {

Просмотреть файл

@@ -371,9 +371,9 @@ export default class BrowseChannels extends React.PureComponent<Props, State> {
return ( return (
<GenericModal <GenericModal
onExited={this.handleExit}
id='browseChannelsModal' id='browseChannelsModal'
aria-labelledby='browseChannelsModalLabel' aria-labelledby='browseChannelsModalLabel'
onExited={this.handleExit}
compassDesign={true} compassDesign={true}
modalHeaderText={title} modalHeaderText={title}
headerButton={createNewChannelButton('btn-secondary btn-sm')} headerButton={createNewChannelButton('btn-secondary btn-sm')}

Просмотреть файл

@@ -1,7 +1,7 @@
.modal .StatusModal.GenericModal .StatusModal__clear-container.input-clear { .modal .StatusModal.GenericModal .StatusModal__clear-container.input-clear {
position: absolute; position: absolute;
top: 16px; top: 16px;
right: 20px; right: 18px;
color: rgba(var(--center-channel-color-rgb), 0.64); color: rgba(var(--center-channel-color-rgb), 0.64);
opacity: 1; opacity: 1;
} }

Просмотреть файл

@@ -92,7 +92,6 @@ export class QuickInput extends React.PureComponent<Props> {
delayInputUpdate: false, delayInputUpdate: false,
value: '', value: '',
clearable: false, clearable: false,
tooltipPosition: 'bottom',
}; };
componentDidMount() { componentDidMount() {
@@ -133,7 +132,7 @@ export class QuickInput extends React.PureComponent<Props> {
this.input = input; this.input = input;
}; };
private onClear = (e: React.MouseEvent<HTMLDivElement> | React.TouchEvent) => { private onClear = (e: React.MouseEvent<HTMLButtonElement> | React.TouchEvent) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
@@ -187,29 +186,28 @@ export class QuickInput extends React.PureComponent<Props> {
); );
const showClearButton = this.props.onClear && (clearableWithoutValue || (clearable && value)); const showClearButton = this.props.onClear && (clearableWithoutValue || (clearable && value));
return (<div className='input-wrapper'>
{inputElement} return (
{showClearButton && <div className='input-wrapper'>
<div {inputElement}
data-testid='input-clear' {showClearButton && (
className={classNames(clearClassName, 'input-clear visible')} <WithTooltip title={clearableTooltipText}>
onMouseDown={this.onClear} <button
onTouchEnd={this.onClear} data-testid='input-clear'
role='button' className={classNames(clearClassName, 'input-clear visible')}
> onClick={this.onClear}
<WithTooltip >
title={clearableTooltipText} <span
> className='input-clear-x'
<span aria-hidden='true'
className='input-clear-x' >
aria-hidden='true' <i className='icon icon-close-circle'/>
> </span>
<i className='icon icon-close-circle'/> </button>
</span> </WithTooltip>
</WithTooltip> )}
</div> </div>
} );
</div>);
} }
} }

Просмотреть файл

@@ -43,10 +43,9 @@ exports[`components/search_bar/SearchBar should match snapshot with search 1`] =
type="search" type="search"
value="test" value="test"
/> />
<div <button
class="input-clear visible" class="input-clear visible"
data-testid="input-clear" data-testid="input-clear"
role="button"
> >
<span <span
aria-hidden="true" aria-hidden="true"
@@ -56,7 +55,7 @@ exports[`components/search_bar/SearchBar should match snapshot with search 1`] =
class="icon icon-close-circle" class="icon icon-close-circle"
/> />
</span> </span>
</div> </button>
</div> </div>
</div> </div>
</form> </form>
@@ -115,10 +114,9 @@ exports[`components/search_bar/SearchBar should match snapshot with search, with
type="search" type="search"
value="test" value="test"
/> />
<div <button
class="input-clear visible" class="input-clear visible"
data-testid="input-clear" data-testid="input-clear"
role="button"
> >
<span <span
aria-hidden="true" aria-hidden="true"
@@ -128,7 +126,7 @@ exports[`components/search_bar/SearchBar should match snapshot with search, with
class="icon icon-close-circle" class="icon icon-close-circle"
/> />
</span> </span>
</div> </button>
</div> </div>
</div> </div>
</form> </form>

Просмотреть файл

@@ -194,7 +194,6 @@ exports[`component/user_group_popover should match snapshot 1`] = `
onChange={[Function]} onChange={[Function]}
onClear={[Function]} onClear={[Function]}
placeholder="Search members" placeholder="Search members"
tooltipPosition="bottom"
type="text" type="text"
value="" value=""
> >

Просмотреть файл

@@ -63,9 +63,10 @@
height: 100%; height: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: none;
margin: 0; margin: 0;
background: none;
color: rgba(var(--center-channel-color-rgb), 0.64); color: rgba(var(--center-channel-color-rgb), 0.64);
cursor: pointer;
font-size: 16px; font-size: 16px;
visibility: hidden; visibility: hidden;