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

Fixed Issue with Search Bar #209

Merged
merged 16 commits into from
Nov 25, 2024
Merged

Fixed Issue with Search Bar #209

merged 16 commits into from
Nov 25, 2024

Conversation

itz-rj-here
Copy link
Collaborator

@itz-rj-here itz-rj-here commented Nov 23, 2024

When clicking on the Search Bar 2 times the outline of the Search Bar goes invisible. Now it's fixed.

itz-rj-here and others added 14 commits November 20, 2024 22:29
 if mouse cursor is within resultBox, then keyboard selection is unhighlighted
Coloring in Search Suggestion when accessing through keyboard and some visual changes on resultBox
Co-authored-by: prem-k-r <60751338+prem-k-r@users.noreply.github.com>
decreasing gap between searchbar and suggestion box
decreasing gap between searchbar and suggestion box
decreasing gap between searchbar and suggestion box
Co-authored-by: prem-k-r <60751338+prem-k-r@users.noreply.github.com>
- Removed Useless comment and space

It's actually not possible it to add focus on the extention's search bar cause chrome defaultly focuses to their search bar.
@prem-k-r
Copy link
Collaborator

image
Ouline border when active is missing

@itz-rj-here
Copy link
Collaborator Author

image
Ouline border when active is missing

I will check that after 5 hours.

Co-Authored-By: Prem Kumar <60751338+prem-k-r@users.noreply.github.com>
@itz-rj-here
Copy link
Collaborator Author

itz-rj-here commented Nov 24, 2024

@prem-k-r Added outline color as you requested. Now review it bruh. -_-

@itz-rj-here itz-rj-here reopened this Nov 24, 2024
@itz-rj-here
Copy link
Collaborator Author

itz-rj-here commented Nov 24, 2024

Sorry accidently clicked on the close button :)

@itz-rj-here
Copy link
Collaborator Author

@prem-k-r have you checked it still?

Copy link
Collaborator

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

Doesn't seems to working correctly.

@itz-rj-here
Copy link
Collaborator Author

Doesn't seems to working correctly.

I can see it works
w8 let me give you a recording.

@itz-rj-here
Copy link
Collaborator Author

Uhh I understand but chrome defaultly uses the focus for their search bar thats way it shows like this.

https://screenrec.com/share/25xwUkYCVH

@prem-k-r
Copy link
Collaborator

prem-k-r commented Nov 24, 2024

Uhh I understand but chrome defaultly uses the focus for their search bar thats way it shows like this.

screenrec.com/share/25xwUkYCVH

I know, but that's not the problem.

What happening after adding code

  • When a new tab is opened or the current tab is reloaded, the search bar outline becomes visible, even though the cursor appears in the browser's search bar — which is not the desired behavior.
  • However, if the user clicks on the search bar and then refreshes, the cursor appears in the extension's search bar with the outline active — this behavior is somewhat acceptable.

@itz-rj-here
Copy link
Collaborator Author

Uhh I understand but chrome defaultly uses the focus for their search bar thats way it shows like this.
screenrec.com/share/25xwUkYCVH

I know, but that's not the problem.

What happening after adding code

  • When a new tab is opened or the current tab is reloaded, the search bar outline becomes visible, even though the cursor appears in the browser's search bar — which is not the desired behavior.
  • However, if the user clicks on the search bar and then refreshes, the cursor appears in the extension's search bar with the outline active — this behavior is acceptable.

Hmm. Need to think more deeper. Let me try to fix it.

@prem-k-r
Copy link
Collaborator

prem-k-r commented Nov 24, 2024

I think we should discard this, as the browser's search bar cursor overrides it.

Instead implement that the search bar becomes active when clicked anywhere. I had done this last time when I was trying:
image

document.addEventListener("click", () => {
    const searchInput = document.getElementById("searchQ");
    searchInput.focus();
    searchbar.classList.add('active');
});

We just need to add a condition:
if (condition) {
// Check if the clicked element is a menu button
return; // Do nothing if the menu button is clicked
}

more conditions, when searchbar is already active and clicked AI tools or Google apps button then inactive the seachbar.
and also for usertext

@itz-rj-here
Copy link
Collaborator Author

I think we should discard this, as the browser's search bar cursor overrides it.

Instead implement that the search bar becomes active when clicked anywhere. I had done this last time when I was trying: image

document.addEventListener("click", () => {
    const searchInput = document.getElementById("searchQ");
    searchInput.focus();
    searchbar.classList.add('active');
});

We just need to add a condition: if (condition) { // Check if the clicked element is a menu button return; // Do nothing if the menu button is clicked }

Let me still try to find something if i find something

@itz-rj-here
Copy link
Collaborator Author

I found a useless idea from gpt for the first time. GPT gave me this extention to make it focus.

https://chromewebstore.google.com/detail/search-box-focus/amgmdnojamodmpfjaokfgpijhpcednjm

@itz-rj-here
Copy link
Collaborator Author

I think we should discard this, as the browser's search bar cursor overrides it.

Instead implement that the search bar becomes active when clicked anywhere. I had done this last time when I was trying: image

document.addEventListener("click", () => {
    const searchInput = document.getElementById("searchQ");
    searchInput.focus();
    searchbar.classList.add('active');
});

We just need to add a condition: if (condition) { // Check if the clicked element is a menu button return; // Do nothing if the menu button is clicked }

one more condition, when searchbar is already active and clicked AI tools or Google apps button then inactive the seachbar.

Actually the clicking anywhere to make the searchbar active is a worst idea actually for me.

@itz-rj-here itz-rj-here marked this pull request as draft November 24, 2024 16:02
@prem-k-r
Copy link
Collaborator

prem-k-r commented Nov 24, 2024

I found a useless idea from gpt for the first time. GPT gave me this extention to make it focus.

chromewebstore.google.com/detail/search-box-focus/amgmdnojamodmpfjaokfgpijhpcednjm

check out their github, if we can implement what we wants from it
https://github.com/MikesGlitch/Focus-First-Input/tree/master/src

@itz-rj-here
Copy link
Collaborator Author

I found a useless idea from gpt for the first time. GPT gave me this extention to make it focus.
chromewebstore.google.com/detail/search-box-focus/amgmdnojamodmpfjaokfgpijhpcednjm

check there github https://github.com/MikesGlitch/Focus-First-Input/tree/master/src

I already tried it. I don't still see any solution for this.
I think we should close this pr. I don't see any solution for this for now. As the chrome browser defaultly focuses to their searchbar.

What you think? If you agree i will close this pr.

@prem-k-r
Copy link
Collaborator

ok

When clicking on the Search Bar 2 times the outline of the Search Bar goes invisible. Now it's fixed.
@itz-rj-here itz-rj-here reopened this Nov 24, 2024
@itz-rj-here itz-rj-here changed the title Added Focus on Search Bar Fixed Issue with Search Bar Nov 24, 2024
@itz-rj-here itz-rj-here marked this pull request as ready for review November 24, 2024 16:58
Copy link
Collaborator

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

Great

@XengShi XengShi merged commit 13b99fd into XengShi:main Nov 25, 2024
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.

3 participants