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

fix(enhancers): Made enhancers position dependent on where you click enhancers from, if mobile, setting floating to true. hide scrollbars in chrome #286

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

WanderingHogan
Copy link
Contributor

What this PR does 📖
These changes make the enhancers menu show up close to where the user clicks the enhancer from on desktop. On mobile it defaults to a floating enhancer. This also removes the chrome scrollbar for the enhancer.

Which issue(s) this PR fixes 🔨

Fixes # SA-187

Special notes for reviewers 🗒️
Tested on desktop and through mobile view in chrome devtools. Reload in between aspect ratio/form factor changes. This is mostly taken from the @KemoPaw's recent PR

Additional comments 🎤

Copy link
Contributor

@KemoPaw KemoPaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks snazzy, code works!

/* Prevent toggle twice when toggle enhancer button is clicked (for mobile case ) */
const chatToggleEnhancer = document.getElementById('chat-enhancer-toggle')
// @ts-ignore
// // @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just delete this and the this.click above?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible on this, we should use refs, using document selectors is an antipattern in vue.

/* Prevent toggle twice when toggle enhancer button is clicked (for mobile case ) */
const chatToggleEnhancer = document.getElementById('chat-enhancer-toggle')
// @ts-ignore
// // @ts-ignore

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible on this, we should use refs, using document selectors is an antipattern in vue.

@@ -26,6 +26,10 @@ const InitalUIState = (): UIState => ({
enhancers: {
show: false,
floating: false,
position: [0, 0],
defaultWidth: '24rem',
defaultHeight: '30rem',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love storing these values in state, can we use global less vars here? Do these need to be dynamic? IF so can we use less selectors for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved these to state because we need them in the style and for a calculation to detect if the enhancers component would be off screen

@stavares843 stavares843 added the Changes Requested Changes have been requested by Dev or QA, once the changes have been made, remove this label. label Nov 22, 2021
…from, if mobile, setting floating to true. hide scrollbars in chrome. #SA-187 and #AP-112.
@InfamousVague InfamousVague merged commit 004a1a9 into dev Nov 25, 2021
@InfamousVague InfamousVague deleted the sa-187 branch November 25, 2021 01:13
@github-actions github-actions bot removed the Changes Requested Changes have been requested by Dev or QA, once the changes have been made, remove this label. label Nov 25, 2021
InfamousVague pushed a commit that referenced this pull request Dec 5, 2021
…from, if mobile, setting floating to true. hide scrollbars in chrome. #SA-187 and #AP-112. (#286)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants