-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Long lines in code blocks should not wrap issue (#7497) is fixed #8790
Merged
NikkiWines
merged 21 commits into
Expensify:main
from
orkunkarakus:fix/7497-LongLinesInCode
May 9, 2022
Merged
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
51d50ef
Long lines in code blocks should not wrap #7497 is fixed
orkunkarakus df73cb6
isHoverable native function created
orkunkarakus 06ea7d4
isHoverable native function name changed to hasHoverSupport
orkunkarakus feab630
mWeb long press context menu does not showed issue fixed
orkunkarakus 9320a72
for fixed the scroll bar cuts off the content while hover the scroll …
orkunkarakus 44a7e7d
for fixed the scroll bar cuts off the content while hover the scroll …
orkunkarakus f3ab154
refactoring styles
orkunkarakus f0b3163
refactoring styles
orkunkarakus 6ad7c2b
refactoring styles
orkunkarakus b08e731
empty space in file name fixed
orkunkarakus 0adeded
two_finger_scrolling from inverted mouse scroll bug fixed
orkunkarakus 3772dba
hooks converted to class components
orkunkarakus e670bc0
class component converted to functinal component
orkunkarakus b52d0e0
style refactoring
orkunkarakus 883eb79
style refactoring
orkunkarakus 2d885fa
style refactoring
orkunkarakus 1ac6aef
ref callback
orkunkarakus 5c13765
class component return back to functional component
orkunkarakus 32de902
refactoring
orkunkarakus afecb5d
style refactoring
orkunkarakus 9f2ce1a
refactor styles
orkunkarakus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import {ScrollView} from 'react-native-gesture-handler'; | ||
import {View} from 'react-native'; | ||
import _ from 'underscore'; | ||
import withLocalize from '../../withLocalize'; | ||
import htmlRendererPropTypes from './htmlRendererPropTypes'; | ||
|
||
const PreRenderer = (props) => { | ||
const TDefaultRenderer = props.TDefaultRenderer; | ||
const defaultRendererProps = _.omit(props, ['TDefaultRenderer']); | ||
|
||
return ( | ||
<ScrollView horizontal> | ||
<View onStartShouldSetResponder={() => true}> | ||
<TDefaultRenderer | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...defaultRendererProps} | ||
/> | ||
</View> | ||
</ScrollView> | ||
); | ||
}; | ||
|
||
PreRenderer.propTypes = htmlRendererPropTypes; | ||
PreRenderer.displayName = 'PreRenderer'; | ||
|
||
export default withLocalize(PreRenderer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Allows us to identify whether the platform is hoverable. | ||
* | ||
* @returns {Boolean} | ||
*/ | ||
|
||
const hasHoverSupport = () => false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove space from the file name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue fixed |
||
|
||
export default hasHoverSupport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Allows us to identify whether the platform is hoverable. | ||
* | ||
* @returns {Boolean} | ||
*/ | ||
|
||
import * as Browser from '../Browser'; | ||
|
||
const hasHoverSupport = () => !Browser.isMobile(); | ||
|
||
export default hasHoverSupport; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not able to scroll via touchpad two-finger scrolling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parasharrajat The reason for this issue is inverted scroll on InvertedFlatList component.
In InvertedFlatList this function is creating error. Because here making scroll manually and force to stop other scrolling operations with preventDefault()
I did some work on this issue but the only solution is remove the manual scroll operation from InvertedFlatList component.
Disabled the inverted scroll
Ekran.Kaydi.2022-05-03.01.53.53.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not call that the only solution. Please take some time and try to come up with some approaches and we can decide the best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parasharrajat Okay, I'll spend more time, but it is absolutely necessary to remove preventDefault from that function.
Now i am working on how we can proceed for inverted scroll without preventDefault
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parasharrajat I did some research and realized that a similar issue has been encountered on the platform before.
Issue Link
When I look at the solution of this problem, if it is in the edit box, it override the parent wheel listener in the list. When I saw that this is an approved solution, I developed a solution similar to this and if our code block is have a scrollable length then i removing the parent listener when trying to scroll this code block.
Changes
Native and web codes are separated. Nothing has been changed in native, a listener has been added to the code block on the web side.
PR Ready.
Simulation Videos
native app
expensify-native.mp4
web
expensify-web.mp4
desktop
expensify-desktop.mov