Turbo-Drive / Turbo-Stream - Clicking on a link does not update browser address bar / history - hotwire-rails

My page has turbo-drive and turbo-stream enabled.
When I click on a link, Turbo-Drive makes AJAX call, receives turbo stream template and replaces the dom as intended. However, the address bar on the browser is not being updated.
I have tried these variations without success:
<a class="page-link" rel="next" data-turbo-stream href="/page">Page</a>
<a class="page-link" rel="next" data-turbo-action="advance" data-turbo-stream data-turbo="true" href="/page">Page</a>
What am I missing?

Related

Google One Tap signout

I am implementing Google One Tap in my website, however I am unable to prevent the popup from spawning immediately after the logout. I know I could manually set a cookie for that, however the official documentation suggests to add the class g_id_signout to any link or button used for the logout. In my menu I have this entry:
<li>
<a id="public-logout" class="g_id_signout" href="#logout"> <wk:text
name="public_area.logout"/></a>
</li>
but the popup still shows immediately after the logout. For reference, the "X" button on the One Tap popup triggers the cooldown regularly. Any idea?
Is the link dynamically created after Google One Tap library loaded?
If that's the case, the library cannot add correct event handler to this link.
You can try to add the click event handler by yourself with the example code below:
<li>
<a id="public-logout" onclick="google.accounts.id.disableAutoSelect(); return true;" href="#logout"> <wk:text
name="public_area.logout"/></a>
</li>
Or, you can bind the click event hander by JavaScript code.
More details at: https://developers.google.com/identity/one-tap/web/reference/js-reference#google.accounts.id.disableAutoSelect

Why is my css class not firing upon initial load?

I have a bootstrap tabbed component on my page. I am trying to control which tab is active upon reload of the page. But, on initial load the behavior of the tab is very peculiar. Here is the code:
<li #(Model.tab == 1 ? "class=tab-pane active" : "class=tab-pane" id="tab1"><l1>
what it is showing in the markup and it is not working is (notice the active out outside the quotes
<li class="tab-pane" active id="tab1"><l1>
the behavior only happens on inital load, but it the tabs are pressed, the behavior is normal, but the extra "active" remains. I am confused where the active outside the quotes is coming from?
The problem is your output doesn't render the double quotes so it looks like this, where the active class doesn't get attached to anything but the browser will just see it as a standalone attribute:
<li class=tab-pane active id="tab1"><l1>
Instead try this:
<li class="#(Model.tab == 1 ? "tab-pane active" : "class=tab-pane")" id="tab1"><l1>

Asp.Net while using tabbing in bootstrap can not retain focus on selected tab on post back

I'm using a bootstrap template for my project while using tabbing when page postback from 2nd tab again first tab shows on. I tried different things but wont work please help.
<div id="validationWizard" class="basic-wizard">
<ul class="nav nav-pills nav-justified">
<li><span>1 :</span> Basic Details</li>
<li><span>2:</span> Family Details</li>
<li><span>3:</span> Previous School</li>
<li><span>4:</span> Document Details</li>
<li><span>5:</span> Registration Details</li>
<li><span>5:</span> Save Details</li>
</ul>
</div>
You will need to maintain the state of the tabs explicitly by saving the current tab index in hidden field and setting current tab after page renders using javascript/jquery. As you are applying tabs style on client-side, server doesn't know about the state of the current active tab. If you use asp.net ajax control toolkit - tab control then ASP.NET automatically maintain the state of the tab.

when i use link target _blank then onClick new tab open and suddenly tab again close

I search too much on Google but i couldn't find any result so i'm posting my question here
I'm using wordpress 3.6 and the wp e-commere plugin
i'm use this anchor tag
<a target="_blank" href="http://www.google.com">google</a>
i also use window.open(url,'_blank'); // function do same problem
when a user clicks on the link, a new tab opens and within 1 second it closes again.. its not working in mozilla and chrome, but it is working in IE
i checked and there is no theme problem.
if i add an anchor tag from e-commerce product then the tag target=_blank will not work, and if i add a anchor tag from wp product then the anchor tag will work...
How can i solve this problem?
and if i add href value with out http:// e.g
google
it opens in new tab successfully
but then its url is
localhost/wordpress/product/www.google.com
if i write a proper href with http://, so there is open and close issue.
Any one know it solution ?
i apply many type of jquery and javascript code, but actually when i write _blank, and then new tab opening then issue comes
Update:
i'm adding some javascript code,
i use this method to open new tab
function urltarget(url,target){
if (target == '') {
target = '_self';
}
window.open(url,target);
return false;
}
if i enter
<a href="" onclik="urltarget('http://www.example.com','_blank');" > Example </a>
//its work ok, but if i used .net url
<a href="" onclik="urltarget('http://www.example.net','_blank');" > Example </a>
//when .net comes in url then it create problem, new tab open and again close.
but it work in IE

Using selenium webdriver to get login to popup via click

I am writing a test script using Selenium web driver (IE). I had no luck trying to get a popup login to display (in iframe) via click. It is an asp.net web application and this is the html that is rendered:
<span class='loggedOut'>
<a class='logInOut logIn popupLink' href='#'>Log In</a>
<span class='divider mini-hidden'>|</span>
<a class='logInOut register mini-hidden' href='/Forms/Registration.aspx'>Register</a>
</span>
This is the selenuim syntax that I have used, nothing worked:
lbi.findElement(By.xpath("//div[#class='logInOut logIn popupLink']")).click();
or
lbi.findElement(By.classname("logInOut logIn popupLink")).click();
or
lbi.findElement(By.ByLinkText("Log In")).click();
I add to use .sendkeys method and send "Enter" as a key. It did the trick in IE8.

Resources