Fossil SCM

chat: disabled sticky mode of the input area for the time being due to grief in conjunction with message scrolling. When toggling between bottom/top modes, scroll to the input area.

stephan 2020-12-26 17:22 trunk
Commit ba3ebf0de93178a7c7993236b052fa59299e9f66641b5ac6be557bf9eacd5f7a
2 files changed +12 -1 +2 -1
+12 -1
--- src/chat.js
+++ src/chat.js
@@ -660,11 +660,22 @@
660660
boolValue: ()=>document.body.classList.contains('chat-bottom-up'),
661661
callback: function(){
662662
document.body.classList.toggle('chat-bottom-up');
663663
Chat.settings.set('bottom-up',
664664
document.body.classList.contains('chat-bottom-up'));
665
- Chat.e.inputWrapper.scrollIntoView();
665
+ if(false){
666
+ /* Reminder: in order to get a good scrolling effect when
667
+ sticky mode is enabled for Chat.e.inputWrapper, BOTH of
668
+ these scrollIntoView() calls are needed. */
669
+ const e = document.querySelector(
670
+ '.message-widget'/*this is always the most recent message,
671
+ even if flexbox placed it at the end of
672
+ the page!*/
673
+ );
674
+ if(e) e.scrollIntoView();
675
+ }
676
+ setTimeout(()=>Chat.e.inputWrapper.scrollIntoView(), 0);
666677
}
667678
},{
668679
label: "Images inline",
669680
boolValue: ()=>Chat.settings.getBool('images-inline'),
670681
callback: function(){
671682
--- src/chat.js
+++ src/chat.js
@@ -660,11 +660,22 @@
660 boolValue: ()=>document.body.classList.contains('chat-bottom-up'),
661 callback: function(){
662 document.body.classList.toggle('chat-bottom-up');
663 Chat.settings.set('bottom-up',
664 document.body.classList.contains('chat-bottom-up'));
665 Chat.e.inputWrapper.scrollIntoView();
 
 
 
 
 
 
 
 
 
 
 
666 }
667 },{
668 label: "Images inline",
669 boolValue: ()=>Chat.settings.getBool('images-inline'),
670 callback: function(){
671
--- src/chat.js
+++ src/chat.js
@@ -660,11 +660,22 @@
660 boolValue: ()=>document.body.classList.contains('chat-bottom-up'),
661 callback: function(){
662 document.body.classList.toggle('chat-bottom-up');
663 Chat.settings.set('bottom-up',
664 document.body.classList.contains('chat-bottom-up'));
665 if(false){
666 /* Reminder: in order to get a good scrolling effect when
667 sticky mode is enabled for Chat.e.inputWrapper, BOTH of
668 these scrollIntoView() calls are needed. */
669 const e = document.querySelector(
670 '.message-widget'/*this is always the most recent message,
671 even if flexbox placed it at the end of
672 the page!*/
673 );
674 if(e) e.scrollIntoView();
675 }
676 setTimeout(()=>Chat.e.inputWrapper.scrollIntoView(), 0);
677 }
678 },{
679 label: "Images inline",
680 boolValue: ()=>Chat.settings.getBool('images-inline'),
681 callback: function(){
682
+2 -1
--- src/default.css
+++ src/default.css
@@ -1662,11 +1662,12 @@
16621662
display: flex;
16631663
flex-direction: column;
16641664
border-bottom: 1px solid black;
16651665
padding: 0.5em 1em;
16661666
margin-bottom: 0.5em;
1667
- position: sticky; top: 0;
1667
+ /*position: sticky; top: 0; disabled for the time being because of
1668
+ scroll-related quirks which are still unresolved. */
16681669
z-index: 100
16691670
/* see notes in #chat-messages-wrapper. The various popups require a
16701671
z-index higher than this one. */;
16711672
}
16721673
body.chat.chat-bottom-up #chat-input-area {
16731674
--- src/default.css
+++ src/default.css
@@ -1662,11 +1662,12 @@
1662 display: flex;
1663 flex-direction: column;
1664 border-bottom: 1px solid black;
1665 padding: 0.5em 1em;
1666 margin-bottom: 0.5em;
1667 position: sticky; top: 0;
 
1668 z-index: 100
1669 /* see notes in #chat-messages-wrapper. The various popups require a
1670 z-index higher than this one. */;
1671 }
1672 body.chat.chat-bottom-up #chat-input-area {
1673
--- src/default.css
+++ src/default.css
@@ -1662,11 +1662,12 @@
1662 display: flex;
1663 flex-direction: column;
1664 border-bottom: 1px solid black;
1665 padding: 0.5em 1em;
1666 margin-bottom: 0.5em;
1667 /*position: sticky; top: 0; disabled for the time being because of
1668 scroll-related quirks which are still unresolved. */
1669 z-index: 100
1670 /* see notes in #chat-messages-wrapper. The various popups require a
1671 z-index higher than this one. */;
1672 }
1673 body.chat.chat-bottom-up #chat-input-area {
1674

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button