我有一个问题和非常奇怪的行为与自动填充铬。当我登录并从应用程序注销时,输入字段(电子邮件、密码)会自动完成,但字段看起来是冻结的,不可单击
这种错误并非每次都会重现,它发生在1/10的情况下。
我注意到在注销时,当字段自动完成时,1秒钟后,输入中的字体变小,之后,如果您单击输入,似乎没有单击,什么也不会发生,但如果您键入一些文本(数字无效,保持冻结状态),输入字段将正常运行
以下是具有奇怪行为的gif:
https://gifyu.com/image/kTkX
我试图设置autocomplete=“off”,但没有工作
我还匹配了输入字段中的所有css类,以查看是否存在一些覆盖css,但一切看起来都很好
<;表单[formGroup]=“loginForm”>;
<;输入id=“emailHeader”type=“text”formControlName=“电子邮件”占位符=“电子邮件”>;
<;输入#password type=“password”formControlName=“password”placeholder=“Lozinka”>;
<;输入type=“submit”(单击)=“executeLogin()”value=“Prijava”>;
</表格>;
我希望自动填充后字段不会冻结
公共登录信息:FormGroup;
公共电子邮件输入:ElementRef;
公共密码输入:ElementRef;
@ViewChild(“电子邮件”)设置emailContent(内容:ElementRef){
this.emailInput=内容;
}
@ViewChild(“密码”)设置密码内容(内容:ElementRef){
this.passwordInput=内容;
}
//用户界面助手
公共showloginfo:boolean;
公共显示平衡:布尔值;
public player:PlayerModel=新的PlayerModel({});
public balanceInfo:BalanceInfoModel=新的BalanceInfoModel({});
public nxcsBalanceInfo:NXCSBalanceInfoModel=新的NXCSBalanceInfoModel({});
公共对话类型=对话类型;
public customMessageError=”;
//贮藏
私人总部状态$:可观察<;任何>;;
private loginState$:可观察<;任何>;;
private playerState$:可观察<;任何>;;
私人emailInput$:可观察<;任何>;;
私有密码输入$:可观察<;任何>;;
私人平衡状态美元:可观察<;任何>;;
私人股本认购:认购;
私人登录订阅:订阅;
私人玩家订阅:订阅;
私人电子邮件订阅:订阅;
私人密码订阅:订阅;
私人余额认购:认购;
//tslint:禁用下一行:无可推断类型
私有左菜单:字符串=“”;
//tslint:禁用下一行:无可推断类型
private rightMenu:string=”;
建造师(
私有authService:authService,
私人fb:FormBuilder,
私人商店:商店<;任何>;,
专用路由:路由器,
专用localStorageService:localStorageService,
私人播放器服务:播放器服务,
私人通知服务:通知服务,
专用dialogService:dialogService,
私人佣工:佣工服务,
专用翻译代码:翻译代码,
私人促销服务:促销服务,
) {
this.loginForm=this.buildLoginForm();
}
恩戈尼尼特(){
这个.setupStore();
}
ngAfterViewInit(){
this.formEventsAfterViewInit();
}
恩贡德斯特罗(){
this.headerSubscription.unsubscribe();
this.loginSubscription.unsubscribe();
此.playerSubscription.unsubscribe();
this.notificationService.closeConnection();
}
公共行政人员{
如果(!this.loginForm.valid){
this.customMessageError=this.translateCode.transform(“空的输入消息”);
回来
}
this.authService.login(新的LoginModel({…this.loginForm.value,详细信息:this.helpers.sendSessionData()}))
.订阅(
数据=>{
this.localStorageService.setUserAfterLogin(data.token);
this.customMessageError=”;
此参数为.loginForm.reset();
this.route.navigate([‘/app/casino’]);
},
错误=>{
error.message.includes(’Račun je zaključan’)?this.store.dispatch(new PopupNotification(error.message)):this.customMessageError=error.message
此.addAfterErrorSubscription();
}
);
}
公共openDialog(dialogType:string):无效{
开关(对话框类型){
案例DialogType.PAYMENT:
this.opendrawAlDialog()
打破
案例对话框类型.付款\押金:
这个.checkRegistrationStep();
打破
案例对话框type.TRANSACTION\u历史记录:
this.store.dispatch(新建OpenDialog({
类型:dialogType,
}));
打破
}
}
公共OpenInternalTransactionDialog():void{
this.promotionService.getPromotionsByLocation(’NXCS\u存款’)
.订阅(
data=>;this.dialogService.openDialog(MENU_DIALOGS.INTERNAL_TRANSACTION,{promotions:data}),
error=>;this.dialogService.openDialog(MENU_DIALOGS.INTERNAL_TRANSACTION,{promotions:[]}),
);
}
public backToRegistrationStep():void{
开关(this.player.registrationStep){
案例1:this.route.navigate([‘/auth/registration/step two’]);
打破
案例2:this.route.navigate([‘/auth/registration/step three’]);
打破
案例3:this.route.navigate([‘/auth/registration/step four’]);
打破
案例4:this.route.navigate([‘/auth/registration/step five’]);
打破
案例5:this.route.navigate([‘/auth/registration/step six’]);
打破
默认值:this.route.navigate([‘/login’]);
打破
}
}
公共切换菜单(对话框):无效{
如果(对话框==’左’){
this.leftMenu=this.leftMenu==对话框?”:对话框;
}
如果(对话框==’right’){
this.rightMenu=this.rightMenu==对话框?”:对话框;
}
这个.dispatchShadow();
}
私有OpenDrawalDialog(_data:any={}):void{
const playerRole=this.localStorageService.getPlayer()[‘profileRole’];
如果(playerRole====’Retraction\u DISABLED’&;this.player.uploadedAdditionalInfo){
this.store.dispatch(新的OpenNotification({type:NotificationType.drawing_DISABLED}));
回来
}
playerRole===‘退出被禁用’?
this.store.dispatch(新的OpenNotification({type:NotificationType.MONEY_Launing})):
this.dialogService.openDialog(菜单_DIALOGS.WHITDRAWALS,_数据);
}
私有openProceedToRegistration():void{
{}.procedue.notificationstore(}.notification.u)类型)
}
private checkRegistrationStep():void{
if(this.player.registrationStep<;6){
这是.openProceedToRegistration();
}否则{
this.dialogService.openDialog(MENU_DIALOGS.depositions,{});
}
}
私有dispatchShadow():void{
如果(this.leftMenu!=”){
this.store.dispatch(新的opendleftmenu());
this.leftMenu=”;
}
如果(此.right菜单!=”){
this.store.dispatch(新的OpenDrightMenu());
this.rightMenu=”;
}
}
私有buildLoginForm():FormGroup{
返回此.fb.group({
电邮:[
”,Validators.compose([Validators.required,Validators.min(5)]),
],
密码:[
”,Validators.compose([Validators.required,Validators.min(5)])
],
});
}
私有loadBalance():void{
this.playerService.getPlayerBalance().toPromise()
.then(data=>;this.store.dispatch(new setplayerbance({balanceInfo:new BalanceInfoModel(data)})))
.然后(()=>{
if(this.player.externalId){
this.playerService.getNXCSPlayerBalance()
.订阅(
data=>;this.store.dispatch(新的SetPlayerNXCSBalance({nxcsBalanceInfo:new-NXCSBalanceInfoModel(data)})),
error=>;console.log(错误),
);
}
});
}
//存储方法
私有setupStore():void{
this.headerState$=this.store.pipe(选择(’headerStore’);
this.loginState$=this.store.pipe(选择(’loginStore’);
this.playerState$=this.store.pipe(选择(’playerStore’);
this.balanceState$=this.store.pipe(选择(’balanceStore’);
this.addSubscriptions();
}
私有formEventsAfterViewInit():void{
if(this.emailInput和&;this.passwordInput){
this.emailInput$=fromEvent(this.emailInput.nativeElement,’focus’);
this.passwordInput$=fromEvent(this.passwordInput.nativeElement,’focus’);
this.addFormEventsSubscriptions();
}
}
私有addFormEventsSubscriptions():void{
this.emailSubscription=this.emailInput$.Subscription(()=>;this.triggerEmailFocus());
this.passwordSubscription=this.passwordInput$.subscripte(()=>;this.triggerPasswordFocus());
}
private triggerEmailFocus():void{
this.emailInput.nativeElement.select();
如果(此.emailSubscription){
此.emailSubscription.unsubscribe();
}
}
private triggerPasswordFocus():void{
this.passwordInput.nativeElement.select();
if(this.passwordSubscription){
此.passwordSubscription.unsubscripte();
}
}
私有addSubscriptions():void{
this.addHeaderSubscription();
this.addLoginSubscription();
this.addPlayerSubscription();
this.setBalanceSubscription();
}
私有addHeaderSubscription():void{
this.headerSubscription=this.headerState$
.subscribe(headerState=>;this.showLoginForm=headerState!==HeaderActionTypes.LoginPage);
}
私有addLoginSubscription():void{
this.loginSubscription=this.loginState$
.订阅(登录状态=>{
如果(登录状态){
这是loadBalance();
this.notificationService.connect(localStorage.getItem(’token’);
}否则{
this.notificationService.closeConnection();
}
this.showBalance=loginState;
this.formEventsAfterViewInit();
});
}
私有addPlayerSubscription():void{
this.playerSubscription=this.playerState$
.subscribe(playerData=>;this.player=playerData);
}
私有addAfterErrorSubscription():void{
this.passwordSubscription=this.passwordInput$.subscripte(()=>{
如果(这是一个)