Skip to content

Conversation

@maryia-deriv
Copy link
Contributor

@maryia-deriv maryia-deriv commented Nov 29, 2023

Before this change:

In responsive and when popover is uncontrolled (when is_open is not provided), an opened tooltip (bubble) hides when a user taps outside but it won't hide when they tap the target (e.g. 'info' icon) again.

Changes:

For responsive only:

  • to hide a tooltip when the target (e.g. 'info' icon) of an uncontrolled popover is tapped.
  • make controlled popovers in DTrader uncontrolled if they were implemented as controlled for the sole purpose of closing when target is tapped. This includes 'Strike' for Vanilla and 'Barriers' for Turbos.

After this change:

Opened tooltips of all uncontrolled popovers in responsive will hide both upon tapping outside and upon tapping the target (e.g. 'info' icon) again.
This behavior is natural, that's why it's applied to all uncontrolled popovers in responsive.

Screenshots:

Screenshot 2023-11-29 at 5 38 19 PM

@vercel
Copy link

vercel bot commented Nov 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Dec 19, 2023 8:01am

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2023

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/11881](https://github.com/binary-com/deriv-app/pull/11881)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-maryia-deriv-maryia-dtra-484controlla-0b5def.binary.sx?qa_server=red.derivws.com&app_id=24068
    - **Original**: https://deriv-app-git-fork-maryia-deriv-maryia-dtra-484controlla-0b5def.binary.sx
- **App ID**: `24068`

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2023

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 15
🟧 Accessibility 88
🟢 Best practices 92
🟢 SEO 92
🟧 PWA 80

Lighthouse ran with https://deriv-app-git-fork-maryia-deriv-maryia-dtra-484controlla-0b5def.binary.sx/

} = useStore();
const [hover_ref, is_hovered] = useHover(null, true);
const [bubble_hover_ref, is_bubble_hovered] = useHoverCallback();
const should_toggle_on_target_tap = React.useMemo(() => is_mobile && is_open === undefined, [is_mobile, is_open]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For responsive only and for uncontrolled popovers only (when is_open is not provided).

relative_render = false,
should_disable_pointer_events = false,
should_show_cursor,
window_border,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unused prop

| zIndex | {number} | null | Z-index for popover container |
| relative\_render | {boolean} | null | Set it true if you want to have popover dom next to the wrapped element |
| should\_disable\_pointer\_events | {boolean} | null | Set it true if you want to disable all events of popover container |
| window\_border | {number} | null | Distance between popover on window sides |
Copy link
Contributor Author

@maryia-deriv maryia-deriv Nov 29, 2023

Choose a reason for hiding this comment

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

i only removed window_border in this file, pre-commit hooks changed the alignment :)

@maryia-deriv maryia-deriv marked this pull request as ready for review November 29, 2023 22:50
@maryia-deriv maryia-deriv changed the title Maryia/DTRA-484/feat: close uncontrolled popover tooltip when target is tapped Maryia/DTRA-484/feat: hide tooltip of an uncontrolled popover when target icon is tapped again Nov 29, 2023
@maryia-deriv maryia-deriv changed the title Maryia/DTRA-484/feat: hide tooltip of an uncontrolled popover when target icon is tapped again Maryia/DTRA-484/feat: hide uncontrolled popover tooltip when target icon is tapped again Nov 29, 2023
@coveralls
Copy link

coveralls commented Nov 30, 2023

Coverage Status

coverage: 33.34% (+0.1%) from 33.222%
when pulling ac91cd4 on maryia-deriv:maryia/DTRA-484/controllable-tooltips
into a231b18 on binary-com:master.

@maryia-deriv maryia-deriv changed the title Maryia/DTRA-484/feat: hide uncontrolled popover tooltip when target icon is tapped again [DTRA] Maryia/DTRA-484/feat: hide uncontrolled popover tooltip when target icon is tapped again Dec 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2023

❌ Smoke test run (1) failed. See logs for details: Visit Action

@github-actions
Copy link
Contributor

❌ Smoke test run (1) failed. See logs for details: Visit Action

@github-actions
Copy link
Contributor

❌ Smoke test run (2) failed. See logs for details: Visit Action

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
3.8% Duplication on New Code

See analysis details on SonarCloud

@github-actions
Copy link
Contributor

❌ Smoke test run (1) failed. See logs for details: Visit Action

@github-actions
Copy link
Contributor

❌ Smoke test run (1) failed. See logs for details: Visit Action

@github-actions
Copy link
Contributor

❌ Smoke test run (2) failed. See logs for details: Visit Action

@balakrishna-deriv balakrishna-deriv merged commit 7ca0c99 into deriv-com:master Dec 21, 2023
lubega-deriv pushed a commit to lubega-deriv/deriv-app that referenced this pull request Dec 26, 2023
…arget icon is tapped again (deriv-com#11881)

* feat: update popover functionality to toggle bubble when target is focused

* chore: removed state control from outside for vanilla and turbos

* docs: update readme

* test: add test for popover

* test: popover

* feat: add useDevice hook to components

* test: fix tests

* revert: unnecessary setting of visibility from events in bubble

Signed-off-by: lubega-deriv <lubega@deriv.com>
lubega-deriv pushed a commit to lubega-deriv/deriv-app that referenced this pull request Dec 26, 2023
…arget icon is tapped again (deriv-com#11881)

* feat: update popover functionality to toggle bubble when target is focused

* chore: removed state control from outside for vanilla and turbos

* docs: update readme

* test: add test for popover

* test: popover

* feat: add useDevice hook to components

* test: fix tests

* revert: unnecessary setting of visibility from events in bubble

Signed-off-by: lubega-deriv <lubega@deriv.com>
farhan-nurzi-deriv pushed a commit to farhan-nurzi-deriv/deriv-app that referenced this pull request Dec 27, 2023
…arget icon is tapped again (deriv-com#11881)

* feat: update popover functionality to toggle bubble when target is focused

* chore: removed state control from outside for vanilla and turbos

* docs: update readme

* test: add test for popover

* test: popover

* feat: add useDevice hook to components

* test: fix tests

* revert: unnecessary setting of visibility from events in bubble

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>
matin-deriv pushed a commit that referenced this pull request Dec 29, 2023
…#12424)

* chore: ✨ unit tests for WalletListCardDetails component

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [TRAH] Hamza/2302/create password component (#12418)

* chore: create password component

* chore: create password component new files

* chore: update the width

* chore: added the description

* chore: destructure the React Fc

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [TRAH] Aizad/TRAH-2305/Content Switcher (#12409)

* chore: added Content Switcher Tab inside of Tradershub package

* fix: updated TSDocs with examples

* fix: split components into different files

* chore: fix sonarcloud issues
- wrapped ContentHeaderList with memo
- wrapped activeIndex, setActiveIndex with memo
- rename useTabIndex to useContentSwitch for global use

* fix: resolve comments

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [DTRA] Maryia/DTRA-484/feat: hide uncontrolled popover tooltip when target icon is tapped again (#11881)

* feat: update popover functionality to toggle bubble when target is focused

* chore: removed state control from outside for vanilla and turbos

* docs: update readme

* test: add test for popover

* test: popover

* feat: add useDevice hook to components

* test: fix tests

* revert: unnecessary setting of visibility from events in bubble

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: added jurisdiction footnote title (#12426)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [FEQ] Ameerul / FEQ-1002 / P2P Order Create Hook (#12246)

* feat: added p2p_order_create hook

* chore: changed comments

* fix: annotations

* chore: added tsdoc for response

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* translations: 📚 sync translations with crowdin (#12432)

Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com>
Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL] Lubega /WALL-3053/ Chore: WalletTextField unit test (#12356)

* chore: wallet textfield unit test

* fix: applied comments

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL?] [Fix] Rostislav / WALL-2260 / Fix legacy cashier crypto withdrawal page error message (#11983)

* fix: the thing

* refactor: padding

* fix: line-height

* refactor: increase gap a bit

* refactor: `margin-inline`

* fix: appearance

* refactor: merge conflict

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* fix: align padding w Figma

* refactor: better css

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* Ako/ fix account status type (#12434)

* ci: fix account status type

* build: update package-lock

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* style: 💄 remove gaps between accounts (#12411)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* style: 💄 fix left and right paddings around label (#12412)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: unused computed value removed payment_methods_list_values from store (#12388)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: ✨ unit test for TradingAccountCard component (#12358)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: ✨ unit tests for WalletListCardBadge component (#12389)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [FEQ] Farhan/FEQ-993/P2P advertiser Adverts (#12262)

* feat: ✨ createuseAdvertiserAdverts hook

* chore: add test for fetchnextpage

* chore: ✨ add doc for function

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* fix: fixed the theme of the df iframe to light mode (#12400)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [TRAH] Hamza/TRAH-2315/added JurisdictionTncSection (#12433)

* chore: added tnc section

* chore: added Link component

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL] Aum/WALL-3001/unit tests for wallet withdrawal-fiat module (#12361)

* chore: added unit tests for WithdrawalFiat module

* chore: changed the format for the data-testid

* chore: added verification code in the tests

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [trah]thisyahlen/chore: add get a deriv account banner (#12430)

* chore: add get a deriv account banner

* fix: import

* fix: added tsdoc

* chore: komen

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [COJ]Amina/coj 407 success message after upgrade (#12338)

* feat: migration success modal

* chore: mobile view of success modal

* fix: mobile

* fix: testcases for migration success modal

* fix: testcases for migration success modal

* fix: testcases for migration success modal

* fix: remove hardcoded values

* fix: review comments

* fix: rename varible

* fix: review comments

* fix: review comments

* fix: loading

* fix:  merge master

---------

Co-authored-by: Taysuisin <suisin@regentmarkets.com>
Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL] Farhan/WALL-2896/Unit test for WalletListCardBalance component (#12399)

* chore: ✨ unit tests for WalletListCardBalance component

* refactor: ⚙️ change description

Co-authored-by: Nijil Nirmal <62882794+nijil-deriv@users.noreply.github.com>

---------

Co-authored-by: Nijil Nirmal <62882794+nijil-deriv@users.noreply.github.com>

* [WALL] george / WALL-2826 / transfer messages from wallet to wallet for unverified users (#12378)

* feat: ✨ add wallet to wallet transfer messages for unverified users

* feat: ✨ add transfer messages between wallets

implement transfer messages between wallets for unverified users, setup localization

* chore: 🚑 fix messages content

* fix: 🚑 setup translations for transfer messages

* fix: 🚑 apply comments

* fix: 🚑 lifetime transfer messages content

* refactor: 🎨 refactor translations, remove config

* perf: 🎨 improve message structure

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [DTRA] Maryia/DTRA-674/fix: Vanilla profit & contract value in mobile (#12336)

* fix: vanilla profit in mobile

* test: the change

* fix: vanilla mobile contract card

* test: positions-modal-card.spec.tsx

* refactor: component and tests

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [BOT]Maryia/BOT-958/feat: adding matches/differs and over/under contract types on quick strategies (#11462)

* feat: adding Matches/differs and over/under contract types on quick strategy

* feat: add prediction tool tip

* feat: validate last digit prediction from 0-9 as text to prevent the user from entering a dot

* feat: add last_digit_prediction to Martingale, D'Alembert, Oscar Grind, and other strategies

* feat: prediction field

* chore: remove minor things

* chore: nitpick change

* fix: cognitive complexity

* fix: value to check existence of a valid variable

* fix: bug when user switches to digits after multipliers trade type category

* refactor: take the function addDinamicallyBlockToDOM() to utils

* fix: change the order and grouping of fields PREDICTION

* fix: minimisation of code, purity

* refactor: add regex prop in the prediction field config

* fix: type script issues in some files

* fix: bug loading saved values into the quick strategies form

* fix: type script issues in some files

* fix: remove unnecessary hidden category

* fix: test case of contract_type component

* fix: sonarcloud code smells

* fix: remove unnecessary changes of bot skeleton

* chore: remove comment

* chore: temporary remove improvement

* refactor: improvement implementation

* fix: save values from the form the first time the browser is used

* test: update trade type test case

* fix: remove unnecessary code, add logic for the field text

* refactor: remove formik mock

* Revert "refactor: remove formik mock"

This reverts commit 00a25a1.

* refactor: validation of prediction block

* refactor: validation of prediction block(2)

* fix: validation of btn minus for prediction block

* fix: validation of btn minus for prediction block(2)

* fix: min/max values

* chore: rename function

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* refactor: ✨ change login id

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* fix: import

---------

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>
Co-authored-by: Muhammad Hamza <120543468+hamza-deriv@users.noreply.github.com>
Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com>
Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Co-authored-by: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com>
Co-authored-by: lubega-deriv <142860499+lubega-deriv@users.noreply.github.com>
Co-authored-by: Rostik Kayko <119863957+rostislav-deriv@users.noreply.github.com>
Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com>
Co-authored-by: Aum Bhatt <125039206+aum-deriv@users.noreply.github.com>
Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com>
Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com>
Co-authored-by: Taysuisin <suisin@regentmarkets.com>
Co-authored-by: Nijil Nirmal <62882794+nijil-deriv@users.noreply.github.com>
Co-authored-by: maryia-matskevich-deriv <103181650+maryia-matskevich-deriv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants