[Rails] About the error when displaying the screen due to the autofocus of the form

This is an error that occurred while developing a personal app with Rails. As a memorandum, I will write from the discovery of the error to its resolution.

Event

When I access the sign-up page on my smartphone (OS: iOS, browser: Google Chrome, Safari), the layout of the page is displayed for a moment, and then the error "This page cannot be opened" occurs.

image.png

However, if you access the URL directly, the page will be displayed normally. (This ended up being a mystery ...)

Research

When I searched for other pages that gave the same error, it also occurred on the profile edit page.

What the sign-up page and the profile edit page have in common is that they have a form for entering user information.

Sign-up page

image.png

Profile edit page

image.png

Cause

If there are multiple autofocus: true forms in one screen, it seems that an error occurs when browsing on a smartphone. So I left autofocus: true only on the very first input form and removed it from the rest of the forms and the error went away. I overlooked it because there was no error when browsing on a PC ... It is good to increase the form by copying and pasting, but you have to maintain this area well.

Recommended Posts

[Rails] About the error when displaying the screen due to the autofocus of the form
[Ruby on Rails] How to Japaneseize the error message of Form object (ActiveModel)
About the function of Spring Boot due to different versions
[Rails] Japanese localization of error message when using Form object
rails [Procedure for displaying an error statement when data transmission fails due to create action]
[Rails] Talk about paying attention to the return value of where
[Rails] About Uglifier :: Error: Unexpected token: at the time of deployment
[Rails 5] How to display the password change screen when using devise
About the error message Invalid redeclaration of'***'
The process of introducing Vuetify to Rails
Perspectives to worry about when doing code reviews of web applications (Rails)
About virtualBox6.1.16, error resolution of shared folder when updating to CentOS Stream
Solved the problem of freezing due to sudden "EXT4-fs error" on Ubuntu 20.04
[Rails] What to do when the Refile image is not displayed when writing the processing at the time of Routing Error
How to find the cause of the Ruby error
[Rails] Button to return to the top of the page
[Rails] When I use form_with, the screen freezes! ??
The road to Japaneseizing Rails devise error messages
[Ruby] Meaning of &. How to avoid the error when the receiver (object) is nil
How to display the result of form input
About the mechanism when displaying the GUI with Docker
About the solution of the error that occurred when trying to create a Japanese file of devise in the Docker development environment
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
Library not loaded when trying to upgrade the version of ruby and rails s
[Rails] How to solve the error "undefined method` visit'" when using Capybara with Rspec
When the hover of Eclipse is hard to see
Japaneseization of Rails error messages [devise / Form objects, etc.]
[Rails] About error resolution when installing devise and activeadmin
[Nuxt x Rails] Proxy settings due to CORS error
[Rails] How to change the column name of the table
[Rails] How to get the contents of strong parameters
I can't get out of the Rails dbconsole screen
About form. ○○ of form_with
About the error that occurred when adding the column name in rails (rails db: migrate, rails db: rollback, add)
How to solve the problem when the value is not sent when the form is disabled in rails and sent
The idea of cutting off when the error is not resolved
A note about the seed function of Ruby on Rails
I want to create a form to select the [Rails] category
A validation error occurred when saving to the intermediate table.
Let's summarize how to extend the expiration date of Rails
[Rails] When the layout change of devise is not reflected
Display an error screen during the download process to response
[Rails] How to display the list of posts by category
When you want to change the MySQL password of docker-compose
[Rails] Where to be careful in the description of validation
About the behavior at the time of error of Files.copy (pathA, pathB)
[Rails] How to convert the URI of the image sent by http to https when using Twitter API
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
[Rails carrier wave] How to not transition to the error screen even if the image upload is not selected
[Programming beginner] What to do when rails s becomes an error in the local development environment
I want to make the frame of the text box red when there is an input error
About the solution to the problem that the log of logback is not output when the web application is stopped
Method definition location Summary of how to check When defined in the project and Rails / Gem
About the handling of Null
about the where method (rails)
About the description of Docker-compose.yml
Error when using rails capybara
The logout function that was implemented from the beginning when webpacker was introduced to Rails 5.2 series stopped working due to no route matches [get] "/ logout" error.
[Rails] How to get the URL of the transition source and redirect
[Rails 6] How to create a dynamic form input screen using cocoon
[Rails / Heroku / MySQL] How to reset the DB of Rails application on Heroku