fix(core): text color of search input, style for the multi-select tag, date-picker autofocus issue (#4799)

This commit is contained in:
3720
2023-11-01 17:28:00 +08:00
committed by GitHub
parent 6aaf550241
commit e5be570f54
4 changed files with 22 additions and 2 deletions

View File

@@ -47,7 +47,12 @@ export const Condition = ({
const args = renderArgs(value, onChange, data.type); const args = renderArgs(value, onChange, data.type);
return ( return (
<div <div
style={{ display: 'flex', userSelect: 'none', alignItems: 'center' }} style={{
display: 'flex',
userSelect: 'none',
alignItems: 'center',
overflow: 'hidden',
}}
> >
<Menu <Menu
items={ items={
@@ -135,7 +140,10 @@ export const Arg = ({
return null; return null;
} }
return ( return (
<div data-testid="filter-arg" style={{ marginLeft: 4, fontWeight: 600 }}> <div
data-testid="filter-arg"
style={{ marginLeft: 4, fontWeight: 600, overflow: 'hidden' }}
>
{data.render({ {data.render({
type, type,
value: value?.value, value: value?.value,

View File

@@ -27,6 +27,7 @@ export const filterItemStyle = style({
borderRadius: '8px', borderRadius: '8px',
background: 'var(--affine-white)', background: 'var(--affine-white)',
padding: '4px 8px', padding: '4px 8px',
overflow: 'hidden',
}); });
export const filterItemCloseStyle = style({ export const filterItemCloseStyle = style({
@@ -58,6 +59,7 @@ export const switchStyle = style({
background: 'var(--affine-hover-color)', background: 'var(--affine-hover-color)',
borderRadius: '4px', borderRadius: '4px',
}, },
whiteSpace: 'nowrap',
}); });
export const filterTypeStyle = style({ export const filterTypeStyle = style({
fontSize: 'var(--affine-font-sm)', fontSize: 'var(--affine-font-sm)',

View File

@@ -6,6 +6,7 @@ export const content = style({
borderRadius: 8, borderRadius: 8,
padding: '3px 4px', padding: '3px 4px',
cursor: 'pointer', cursor: 'pointer',
overflow: 'hidden',
':hover': { ':hover': {
backgroundColor: 'var(--affine-hover-color)', backgroundColor: 'var(--affine-hover-color)',
}, },

View File

@@ -232,6 +232,12 @@ const RulesMode = ({
const count = allowListPages.length + rulesPages.length; const count = allowListPages.length + rulesPages.length;
return ( return (
<> <>
{/*prevents modal autofocus to the first input*/}
<input
type="text"
style={{ width: 0, height: 0 }}
onFocus={e => requestAnimationFrame(() => e.target.blur())}
/>
<div className={clsx(styles.rulesTitle, styles.ellipsis)}> <div className={clsx(styles.rulesTitle, styles.ellipsis)}>
<Trans <Trans
i18nKey="com.affine.editCollection.rules.tips" i18nKey="com.affine.editCollection.rules.tips"
@@ -532,6 +538,9 @@ const PagesMode = ({
value={searchText} value={searchText}
onChange={e => updateSearchText(e.target.value)} onChange={e => updateSearchText(e.target.value)}
className={styles.rulesTitle} className={styles.rulesTitle}
style={{
color: 'var(--affine-text-primary-color)',
}}
placeholder={t['com.affine.editCollection.search.placeholder']()} placeholder={t['com.affine.editCollection.search.placeholder']()}
></input> ></input>
<div className={styles.pagesList}> <div className={styles.pagesList}>