mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
Merge remote-tracking branch 'origin/release/next-js'
This commit is contained in:
commit
773c590055
@ -1,7 +1,7 @@
|
||||
|
||||
const ua = window.navigator.userAgent;
|
||||
|
||||
export const IS_IOS = ua.includes('iPhone');
|
||||
export const IS_IOS = ua.includes('iPhone') || ua.includes('iPad');
|
||||
|
||||
export const IS_SAFARI = ua.includes('Safari') && !ua.includes('Chrome');
|
||||
|
||||
|
@ -443,9 +443,9 @@ function archive(json: any, state: HarkState): HarkState {
|
||||
);
|
||||
if(unarchived.length === 0) {
|
||||
console.log('deleting entire timebox');
|
||||
state.notifications.delete(time);
|
||||
state.notifications = state.notifications.delete(time);
|
||||
} else {
|
||||
state.notifications.set(time, unarchived);
|
||||
state.notifications = state.notifications.set(time, unarchived);
|
||||
}
|
||||
}
|
||||
return state;
|
||||
|
@ -74,6 +74,8 @@ class ChatInput extends Component<ChatInputProps, ChatInputState> {
|
||||
} else {
|
||||
onSubmit(tokenizeMessage(text));
|
||||
}
|
||||
this.chatEditor.current.editor.focus();
|
||||
this.setState({ currentInput: '' });
|
||||
}
|
||||
|
||||
uploadSuccess(url: string) {
|
||||
|
@ -240,17 +240,12 @@ export default class ChatEditor extends Component {
|
||||
rows="1"
|
||||
style={{ width: '100%', background: 'transparent', color: 'currentColor' }}
|
||||
placeholder={inCodeMode ? "Code..." : "Message..."}
|
||||
onChange={event => {
|
||||
this.messageChange(null, null, event.target.value);
|
||||
}}
|
||||
onKeyDown={event => {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
this.submit();
|
||||
} else {
|
||||
this.messageChange(null, null, event.target.value);
|
||||
}
|
||||
}}
|
||||
onChange={event =>
|
||||
this.messageChange(null, null, event.target.value)
|
||||
}
|
||||
onKeyDown={event =>
|
||||
this.messageChange(null, null, event.target.value)
|
||||
}
|
||||
ref={input => {
|
||||
if (!input) return;
|
||||
this.editor = inputProxy(input);
|
||||
|
@ -93,7 +93,7 @@ const log = (level: LogLevel, message: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
const ZONE_SIZE = IS_IOS ? 10 : 80;
|
||||
const ZONE_SIZE = IS_IOS ? 20 : 80;
|
||||
|
||||
|
||||
// nb: in this file, an index refers to a BigInteger and an offset refers to a
|
||||
@ -208,7 +208,8 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
|
||||
const { id, size, data, offset, pendingSize } = this.props;
|
||||
|
||||
if(size !== prevProps.size || pendingSize !== prevProps.pendingSize) {
|
||||
if(this.scrollLocked) {
|
||||
if((this.window?.scrollTop ?? 0) < ZONE_SIZE) {
|
||||
this.scrollLocked = true;
|
||||
this.updateVisible(0);
|
||||
this.resetScroll();
|
||||
}
|
||||
@ -449,21 +450,26 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
|
||||
if(offset === -1) {
|
||||
return;
|
||||
}
|
||||
this.scrollLocked = false;
|
||||
this.updateVisible(Math.max(offset - this.pageDelta, 0));
|
||||
requestAnimationFrame(() => {
|
||||
ref = this.childRefs.get(index.toString());
|
||||
this.savedIndex = null;
|
||||
this.savedDistance = 0;
|
||||
this.saveDepth = 0;
|
||||
requestAnimationFrame(() => {
|
||||
this.savedIndex = null;
|
||||
this.savedDistance = 0;
|
||||
this.saveDepth = 0;
|
||||
});
|
||||
|
||||
ref?.scrollIntoView({ block: 'center' });
|
||||
});
|
||||
} else {
|
||||
this.savedIndex = null;
|
||||
this.savedDistance = 0;
|
||||
this.saveDepth = 0;
|
||||
|
||||
ref?.scrollIntoView({ block: 'center' });
|
||||
requestAnimationFrame(() => {
|
||||
this.savedIndex = null;
|
||||
this.savedDistance = 0;
|
||||
this.saveDepth = 0;
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user