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

Inconsistant behaviour when submitting question while bottom of chat not visible. #2928

Closed
gsoper78 opened this issue Feb 20, 2020 · 6 comments
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.

Comments

@gsoper78
Copy link

Version

4.7.1 CDN IE11 compatible version

Describe the bug

Submitting a question by typing enter / return while the bottom of the chat is not visible causes the chat to scroll to the bottom of the chat and the new answer. Submitting a question by pressnig the submit icon while the bottom of the chat is not visible does not causes the chat to scroll to the bottom of the chat and the new answer is not visible. In my opinion, the former behaviour is preferable.

Steps to reproduce

Ask enough questions to ensure that the chat pane is scrollable.
Scroll up so that the latest answer isn't visible.
Submit a question by pressing the enter / return button.
Observe that the chat pane automatically scrolls down, thus making the new answer visible.
Scroll up again so that the latest answer isn't visible.
Submit another question, this time by clicking the submit icon.
Observe that the chat pane does not automatically scroll down and the new answer is not visible.

Expected behavior

The two methods of submitting a question should result in a consistant response, preferably scrolling automatically to show the resultant answer.

@gsoper78 gsoper78 added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. Pending customer-reported Required for internal Azure reporting. Do not delete. labels Feb 20, 2020
@tdurnford
Copy link
Contributor

@gsoper78 You are correct - the behavior between pressing the send button and using the enter key to send activities to the bot is inconsistent, and I agree that both should scroll the transcript to the bottom of the conversation. To align the differing behaviors, the SendButton should use the useTextBoxSubmit hook which sends the message to the bot, scrolls the conversation to the end, and focuses the send box. @compulim @corinagum Thoughts?

Submit send box with send button (does not scroll to bottom)

button

Submit send box with enter key (scrolls to bottom)

enter

Necessary Code Changes

import React from 'react';

import connectToWebChat from '../connectToWebChat';
import IconButton from './IconButton';
import SendIcon from './Assets/SendIcon';
import useDisabled from '../hooks/useDisabled';
import useLocalizer from '../hooks/useLocalizer';
- import useSubmitSendBox from '../hooks/useSubmitSendBox';
+ import { useTextBoxSubmit } from '../TextBox';

...

const SendButton = () => {
  const [disabled] = useDisabled();
  const localize = useLocalizer();
- const submitSendBox = useSubmitSendBox();
+ const submitSendBox = useTextBoxSubmit();

  return (
    <IconButton alt={localize('TEXT_INPUT_SEND_BUTTON_ALT')} disabled={disabled} onClick={submitSendBox}>
      <SendIcon />
    </IconButton>
  );
};

Additional Context

@tdurnford tdurnford added the customer-replied-to Required for internal reporting. Do not delete. label Feb 20, 2020
@corinagum
Copy link
Contributor

I would just want to make sure this change is tested on both mobile OS's. We've made changes in the past related to the sendbox/submit actions for mobile but don't have the ability to test the behavior right now.

Both submitting via send button and return should have behavior where (if the keyboard is closed), the keyboard either opens in an understandable way or doesn't open. We don't want the keyboard to flash open then closed, or open when the user is not expecting it.

Should we consolidate these issues? They should probably be addressed at the same time.

@stevengum
Copy link
Member

stevengum commented Mar 6, 2020

@tdurnford any updates?

@corinagum corinagum added Triage-E and removed Pending labels Mar 6, 2020
@tdurnford
Copy link
Contributor

tdurnford commented Mar 8, 2020

@stevengum We're planning to address this issue in R9

@compulim compulim removed the R9 label Mar 9, 2020
@cwhitten cwhitten added R10 and removed R9 labels Apr 9, 2020
@compulim
Copy link
Contributor

compulim commented Jun 5, 2020

This one should already be done recently on accessibility push.

Need to verify all behaviors mentioned are delivered.

@tdurnford
Copy link
Contributor

The scroll behaviors for submitting the send box by pressing enter and clicking the send button both scroll the scroll the transcript to the bottom in the latest version of Web Chat - v4.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete.
Projects
None yet
Development

No branches or pull requests

7 participants