88 <Signatures v-if =" hasSignatures" />
99 </div >
1010 <div v-if =" !loading" class =" button-wrapper" >
11+ <NcNoteCard v-if =" showMobileOrientationHint" type =" warning" >
12+ {{ t('libresign', 'For a better signing experience on mobile, rotate your phone to landscape mode.') }}
13+ </NcNoteCard >
1114 <NcNoteCard v-for =" (error, index) in signStore.errors"
1215 :key =" index"
1316 :heading =" error.title || ''"
@@ -433,6 +436,7 @@ const sidebarStore = useSidebarStore() as SidebarStoreContract
433436const identificationDocumentStore = useIdentificationDocumentStore () as IdentificationDocumentStoreContract
434437
435438const loading = ref (true )
439+ const isMobilePortrait = ref (false )
436440const user = ref <UserInfo >({
437441 account: { uid: ' ' , emailAddress: ' ' , displayName: ' ' },
438442 settings: { canRequestSign: false , hasSignatureFile: false , phoneNumber: ' ' },
@@ -472,6 +476,7 @@ const needCreateSignature = computed(() => {
472476 }
473477 return hasVisibleElementsForCurrentUser (visibleElementsDocument .value )
474478})
479+ const showMobileOrientationHint = computed (() => needCreateSignature .value && isMobilePortrait .value )
475480const needIdentificationDocuments = computed (() => identificationDocumentStore .showDocumentsComponent ())
476481const canCreateSignature = computed (() => {
477482 const capabilities = getCapabilities () as LibresignCapabilities
@@ -543,6 +548,19 @@ function clearBlockingSignError() {
543548 signStore .clearSigningErrors ()
544549}
545550
551+ function updateOrientationHint() {
552+ if (typeof window === ' undefined' ) {
553+ isMobilePortrait .value = false
554+ return
555+ }
556+
557+ const isMobileViewport = window .innerWidth <= 512
558+ const isPortrait = window .matchMedia ?.(' (orientation: portrait)' ).matches
559+ ?? window .innerHeight > window .innerWidth
560+
561+ isMobilePortrait .value = isMobileViewport && isPortrait
562+ }
563+
546564function saveSignature() {
547565 if (signatureElementsStore .success .length ) {
548566 showSuccess (signatureElementsStore .success )
@@ -728,6 +746,10 @@ function executeSigningAction(action: string) {
728746}
729747
730748onMounted (async () => {
749+ updateOrientationHint ()
750+ window .addEventListener (' resize' , updateOrientationHint , { passive: true })
751+ window .addEventListener (' orientationchange' , updateOrientationHint )
752+
731753 loading .value = true
732754 signatureElementsStore .signRequestUuid = signRequestUuid .value
733755 signatureElementsStore .loadSignatures ()
@@ -775,6 +797,8 @@ watch(signRequestUuid, (newUuid, oldUuid) => {
775797})
776798
777799onBeforeUnmount (() => {
800+ window .removeEventListener (' resize' , updateOrientationHint )
801+ window .removeEventListener (' orientationchange' , updateOrientationHint )
778802 resetSignMethodsState ()
779803 if (unwatchPendingAction ) {
780804 unwatchPendingAction ()
@@ -792,6 +816,23 @@ defineExpose({
792816 </script >
793817
794818<style lang="scss" scoped>
819+ .document-sign {
820+ display : flex ;
821+ flex-direction : column ;
822+ height : 100% ;
823+ width : 100% ;
824+ overscroll-behavior : contain ;
825+ -webkit-user-select : none ;
826+ user-select : none ;
827+ -webkit-touch-callout : none ;
828+ }
829+
830+ .sign-elements {
831+ flex : 1 ;
832+ overflow : hidden ;
833+ width : 100% ;
834+ }
835+
795836.progress-indicator {
796837 font-weight : bold ;
797838 color : var (--color-primary-element );
0 commit comments